import math from collections import Counter s = raw_input() c = Counter(s) f = math.factorial(len(s)) for v in c.values(): f /= math.factorial(v) print f - 1