function getchoice(a, b) ret = 1 for k = 0, b - 1 do ret = ret * (a - k) end for k = 0, b - 1 do ret = ret / (b - k) end return ret end s = io.read() n = string.len(s) t = {} for i = 1, n do a = string.sub(s, i, i) if (t[a] == nil) then t[a] = 1 else t[a] = t[a] + 1 end end c = 1 for k, v in pairs(t) do c, n = c * getchoice(n, v), n - v end print(c - 1)