Example 11: Count the number of cubes in the given shapes.