In a square grid ($6 \times 6$) that comprises 25 small unit squares each of side 1 cm, how many rectangles (not squares) are there in the grid? This comes under Combinatorics under intersection of parallel lines. I calculated the number of rectangles to be $\binom62 \times \binom62 = 225$. But how does one subtract only the number of squares from this number? Please help.

HINT: Count the squares according to their sizes. There is one square of side $5$, and there are $5^2=25$ of side $1$. How many are there of sides $4,3$, and $2$? (It’s probably easiest to count them in that order, but you should see a pattern pretty quickly.)
It may help to realize that when you’re counting squares of side $k$, once you choose the top and lefthand edges, there’s nothing left to choose: the bottom and righthand edges have to be $k$ units down and over, respectively. Of course this does put some limitations on which edges you can choose for the top and lefthand side.
Added: Indeed, you can carry this same idea further: once you know where the upper lefthand corner is, you know the whole square. How many places are there for the upper lefthand corner of a square of side $k$? It has to be at least $k$ units from the bottom and at least $k$ units from the righthand edge. How many vertices fit that description?
