Counting Squares

How many squares can you find in this 5 by 5 checkerboard?

In general, how many squares will there be in an n by n checkerboard?