print(len({"".join(i) for i in __import__("itertools").permutations(input())}) - 1)