If you consider the "squares" as rectangles, then we can count the number of rectangle sizes there are.
For the size 1x1 there are 12 squares/rectangles.
For the next size which is a 2 x 1, there are 17 rectangles.
For the next size which is a 3 x 1, there are 10 of those rectangles.
For the next size which is a 4 x 1, there are 3 of those rectangles.
For the next size which is a 2 x 2, there are 6 of those squares/rectangles.
For the next size which is 2 x 3, there are 7 of those rectangles.
For the next size which is 2 x 4, there are 2 of those rectangles.
For the next size which is 3 x 4, there is 1 rectangle.
For the last size which is 3 x 3, there are 2 of those squares/rectangles.
Altogether there are 40 rectangles and 20 squares. (You might count squares as rectangles.)