first try to count permutations