In a rectangle opposite sides are equal and that is the same case for squares. So squares are rectangles. This also counts the number of squares.