import itertools s = input() print(len(set(list(itertools.permutations(list(s)))))-1)