import itertools s = input() ans = set() for val in itertools.permutations(s): ans.add(val) print(len(ans)-1)