The number of permutations of M things out of A things of one kind B things of the second kind and C things of other kinds is (A+B+C)!A!B!C!