Can you count the number of squares in the given picture?

The total number of squares are 17.
Let us assume that the smaller square is 1 unit in size.
Number of squares with 1 unit size = 12
Number of squares with 2 unit size = 5
There is no square with 3 unit size.
Thus total number of squares = 12 + 5 = 17.