4. (5 points) Count the number of squares in the figure: $\qquad$.

Translate the text above into English, please keep the original text's line breaks and format, and output the translation result directly.
【Answer】Solution: The number of small squares is: 13;
The number of large squares containing 4 small squares is: 4;
The number of large squares containing 9 small squares is: 1.
Therefore, there are $13+4+1=18$ squares.
Or directly use the formula to first find the number of squares composed of 9 small squares in the middle: $3^{2}+2^{2}+1^{2}=14$, plus the 4 on the sides, totaling $14+4=18$ squares.

Therefore, the answer is: 18.