To count number_of_types, group by type.