import sequtils,strutils,math proc combi(n, t, m : int) : int = var t = min(t, n - t) A = newSeq[int](0) if t < 0: return 0 elif t == 0: return 1 elif t == 1: return n for i in 0.. 1: var g = gcd(A[j], p) p = p div g A[j] = A[j] div g j += 1 result = 1 for a in A: result = (result * a) mod m var S = stdin.readline cnt : array['A' .. 'Z' , int] ans = 1 l = S.len for c in S: cnt[c] += 1 for c in cnt: ans = (ans * combi(l, c, 573)) mod 573 l -= c echo ans - 1