#include<bits/stdc++.h> #define endl '\n' #define int long long usingnamespace std; using ll = longlong;
bool multi = 0;
voidsolve(){ string s; cin >> s; int n = s.size(); int ans = 0; sort(s.begin(), s.end()); do { bool f = 1; for(int i = 1; i < n; i++) { if(s[i] == s[i - 1]){ f = 0; break; } } ans += f; }while(next_permutation(s.begin(),s.end())); cout << ans << '\n'; }
signedmain(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int T = 1; if (multi) cin >> T; while (T--) { solve(); } return0; }