count number of types