counting list permutations