begin counting permutations