#include #include #include #include #include #include #define rep(i, n) for(i = 0; i < (n); i++) #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = min(x, y) #define MOD 1000000007 #define PI 3.14159265358979323846 #define INF 1 << 30 using namespace std; typedef long long ll; typedef pair pp; int Combi(int n, int k) { chmin(k, n - k); if (k == 0) return 1; int i, ans = 1; for (i = 1; i <= k; i++) { ans *= n; ans /= i; } return ans; } int main(void) { int num, i, ans = 1; string s; vector d(26, 0); cin >> s; num = s.size(); rep(i, num) d[s[i] - 'a']++; rep(i, 26) { ans *= Combi(num, d[i]); num -= d[i]; } cout << ans << "\n"; return 0; }