from itertools import permutations print(len(set(permutations(input()))) - 1)