This first colored image shows eight specific squares.

This next image shows a total of 18 additional squares (eight red, eight blue, and two green).

This image shows another four squares, by combining the smaller ones into 2x2 squares. But wait!...

Here's another couple of squares...

And another couple...

And one last 2x2 square.

This image demonstrates how we can count another four squares by combing the smaller ones into 3x3 squares...

And please don't forget, the outer grid itself is also a square! (It makes a 4x4 square.)

So, how does this add up?

So, we have 8 + 18 + 9 + 4 + 1, which is a grand total of forty (40) squares!

So... How many did you find? ;-)