How Many Squares?

The answer is 40.

Note: It may take a while for the page to load.