s = input() word_count = {} def fact(n): if n == 0: return 1 return n * fact(n -1) for i in s: if i not in word_count: word_count[i] = 1 else: word_count[i] += 1 cases = fact(len(s)) for i in word_count.values(): cases //= fact(i) print(cases)