Partition a rectangle into rows and columns of same-size squares to form an array and count to find the total number of parts.