Problem 4.3. How many rectangles exist on this picture with sides running along the grid lines? (A square is also a rectangle.)

![](https://cdn.mathpix.com/cropped/2024_05_06_4984b677816e04f7f1c9g-06.jpg?height=173&width=206&top_left_y=614&top_left_x=624)
Answer: 24.

Solution. In a horizontal strip $1 \times 5$, there are 1 five-cell, 2 four-cell, 3 three-cell, 4 two-cell, and 5 one-cell rectangles. In total, $1+2+3+4+5=15$ rectangles.

In a vertical strip $1 \times 4$, there are 1 four-cell, 2 three-cell, 3 two-cell, and 4 one-cell rectangles. In total, $1+2+3+4=10$ rectangles. At the same time, one one-cell rectangle at the intersection of the strips is counted twice (and only it is). Therefore, the answer to the problem is the number $15+10-1=24$.