If it's just "solid" squares (not broken up by lines), then it would be 16 (the 4 "regular" squares down the left side, the four "regular" squares down the right side, and the 8 "small" squares in the middle.
If you do include lines, then here is how I got to 40:
1 - 4x4 square
4 - 3x3 squares
9 - 2x2 squares
18 1x1 squares (16 + the 2 reguar size ones in the middle)
8 - "little" squares
So I'm not sure if I'm missing any.