SPOJ - Feynman

How many different squares are there in a grid of N×N squares?