The number of squares that we can find on a chess board is
64
160
224
204
To get a square of size r x r, we must choose (r + 1) consecutive horizontal and (r + 1) consecutive vertical lines. This can be done in (9 – r) (9 – r) = (9 – r)2 ways.