We will do this problem in parts.

1)How many 1x1 squares? The answer is 5^2 = 25

2)How many 2x2 squares? The answer is 4^2 = 16

3)How many 3x3 squares? The answer is 3^2 = 9

4)How many 4x4 squares? The answer is 2^2 = 4

5)How many 5x5 squares? The answer is 1^2 = 1

Add those up to get your answer.

---

The problem generalizes.

Given a big square.

Then the total number of square is: