Counting Embedded Figures- Rectangles

How many rectangles are in the figure below? Only consider rectangles that can be formed by the same vertices of the squares.

How many rectangles are in a 3 x 3 figure? 4 x 4 figure?