#include <iostream>
#include <map>
using namespace std;
long long fact (int n) {
return (n == 1 ? n : n * fact (n - 1));
}
int main() {
string s;
map <char, int> m;
cin >> s;
int l = s.size(), count = 1;
for (int i = 0; i < l; i++)
m[s[i]] = (m[s[i]] ? ++m[s[i]] : 1);
for (auto it = m.begin(); it != m.end(); it++)
if (it -> second > 1) count *= fact (it -> second);
cout << fact(l) / count;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWFwPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKbG9uZyBsb25nIGZhY3QgKGludCBuKSB7CglyZXR1cm4gKG4gPT0gMSA/IG4gOiBuICogZmFjdCAobiAtIDEpKTsKfQoKaW50IG1haW4oKSB7CglzdHJpbmcgczsKCW1hcCA8Y2hhciwgaW50PiBtOwoJY2luID4+IHM7CglpbnQgbCA9IHMuc2l6ZSgpLCBjb3VudCA9IDE7Cglmb3IgKGludCBpID0gMDsgaSA8IGw7IGkrKykKCQltW3NbaV1dID0gKG1bc1tpXV0gPyArK21bc1tpXV0gOiAxKTsKCWZvciAoYXV0byBpdCA9IG0uYmVnaW4oKTsgaXQgIT0gbS5lbmQoKTsgaXQrKykgCgkJaWYgKGl0IC0+IHNlY29uZCA+IDEpIGNvdW50ICo9IGZhY3QgKGl0IC0+IHNlY29uZCk7Cgljb3V0IDw8IGZhY3QobCkgLyBjb3VudDsgCglyZXR1cm4gMDsKfQ==