Counting Embedded Figures- Squares

How many squares are in the figure below?

How many squares are in a 3 x 3 figure? In an 4 x 4 figure ?