# How to output the number of polygons in each face of a classic flat body?

For example:A Cuboctahedron is a polyhedron with 14 faces: 8 triangular faces and 6 square faces. It is one of the Archimedean solids and can be constructed by truncating either a cube or an octahedron at their vertices such that the remaining edges are all the same length.

What methods can Mathematica use to understand the composition of these classic flat bodies, the types of polygons they consist of, and how many of each type there are?

PolyhedronData["Cuboctahedron", {"EdgeCount", "FaceCount",
"VertexCount", "VertexCoordinates"}]


My personal attempt only resulted in finding out that it is composed of a total of 14 faces.

How to get 8 triangular faces and 6 square faces?

indexes = PolyhedronData["Cuboctahedron", "FaceIndices"];
pts = PolyhedronData["Cuboctahedron", "VertexCoordinates"];
groups = GatherBy[indexes, Length]
Graphics3D[Thread[{{Red, Blue}, Polygon[pts, #] & /@ groups}]]


{{{4, 10, 8, 2}, {3, 9, 11, 5}, {9, 6, 8, 12}, {3, 1, 2, 6}, {5, 7, 4, 1}, {11, 12, 10, 7}}, {{12, 11, 9}, {3, 5, 1}, {6, 9, 3}, {5, 11, 7}, {8, 10, 12}, {1, 4, 2}, {2, 8, 6}, {7, 10, 4}}}

According to LouisB's comment, using the Length and Tally functions can solve this problem.

list = PolyhedronData["Cuboctahedron", "FaceIndices"]
Length /@ list
Tally[Length /@ list]

(*{{4,6},{3,8}}*)