using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; public class Magatro { static void Main() { List C = new List(); string s = Console.ReadLine(); string w = s; while (s.Length > 0) { string q = s.Replace(s[0].ToString(), ""); C.Add(s.Length - q.Length); s = q; } int ans = kaizyou(w.Length); for(int i = 0; i < C.Count; i++) { ans /= kaizyou(C[i]); } Console.WriteLine(ans-1); } static int kaizyou(int n) { if (n == 0) { return 1; } return n * (kaizyou(n - 1)); } }