Sort:  

if my answer is right, 4x4 =1, 3x3 =4, 2x2=9, 1x1=18, smallest square= 8, so total is 40 squares. thank you for voting.

I think thats 40