#include #include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main(){ string s; cin >> s; sort(s.begin(), s.end()); set st; do{ st.insert(s); }while(next_permutation(s.begin(), s.end())); cout << st.size() - 1 << endl; }