We need to count the number of squares of various sizes in a 4x4 grid:
Total squares = 16 (1x1) + 9 (2x2) + 4 (3x3) + 1 (4x4) = 30 squares