A faster way than counting
Counting every square works, but it is slow for big shapes. Look at how the squares in a rectangle are arranged: they make an array of equal rows.
If a rectangle has 3 rows with 5 squares in each row, it has 5 × 3 = 15 squares. The number of squares in a row is the length, and the number of rows is the width. So:
Area of a rectangle = length × width
A square is a rectangle with four equal sides, so:
Area of a square = side × side