Your mathematics is correct but your understanding of the rules of chess is not. A king on any square that is not on the edge of the board can move to any of eight squares: the four that share a common edge with the one he's on and the four that share only a common vertex.