The production of particles with double, triple and hidden charm in heavy ion collisions is studied in the framework of the statistical coalescence model. According to the postulates of the model, the charm quark-antiquark pairs are created at the initial stage of a heavy ion reaction in hard parton collisions. The amount of charm is assumed to be unchanged at later stages. The charm (anti)quarks are distributed among different hadron species at hadronization according to the laws of statistical physics. Several approaches to the statistical treatment of charm hadronization are considered. The grand canonical approach is appropriate for systems containing large number of charm (anti)quarks. The exact charm conservation and Poissonian fluctuations of the number of charm quark-antiquark pairs should be taken into account, if the average number of these pairs is of oder of unity or smaller. The charm hadronization in a subsystem of a larger system is discussed. It is explained why the canonical approach is not appropriate for the description of charm hadronization. The obtained formulas can be used to calculate the production of charm in heavy ion collisions in a wide energy range.