S = input() l = list(S) from itertools import permutations s = set() for v in permutations(l): s.add("".join(v)) print(len(s)-1)