#include <iostream>
#include <cstring>
#include <map>
using namespace std;
int main() {
char s[15]; //равносильно char * s = new char [15], где 15 - максимальный размер строки
map <char, int> m;
cin >> s;
int l, count = 1;
l = strlen(s);
long long fact[15];
fact[1] = 1;
for (int i = 2; i <= l; i++) //заполняем массив факториалов
fact[i] = fact[i - 1] * i;
for (int i = 0; i < l; i++) //подcчитываем повторения
++m[s[i]];
for (auto it = m.begin(); it != m.end(); it++)
if (it -> second > 1) count *= fact[it -> second];
cout << fact[l] / count;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0cmluZz4KI2luY2x1ZGUgPG1hcD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKIAppbnQgbWFpbigpIHsKICAgIGNoYXIgc1sxNV07IC8v0YDQsNCy0L3QvtGB0LjQu9GM0L3QviBjaGFyICogcyA9IG5ldyBjaGFyIFsxNV0sINCz0LTQtSAxNSAtINC80LDQutGB0LjQvNCw0LvRjNC90YvQuSDRgNCw0LfQvNC10YAg0YHRgtGA0L7QutC4CiAgICBtYXAgPGNoYXIsIGludD4gbTsKICAgIGNpbiA+PiBzOwogICAgaW50IGwsIGNvdW50ID0gMTsKICAgIGwgPSBzdHJsZW4ocyk7CiAgICBsb25nIGxvbmcgZmFjdFsxNV07CiAgICBmYWN0WzFdID0gMTsKICAgIGZvciAoaW50IGkgPSAyOyBpIDw9IGw7IGkrKykgLy/Qt9Cw0L/QvtC70L3Rj9C10Lwg0LzQsNGB0YHQuNCyINGE0LDQutGC0L7RgNC40LDQu9C+0LIKICAgICAgICBmYWN0W2ldID0gZmFjdFtpIC0gMV0gKiBpOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsOyBpKyspIC8v0L/QvtC0Y9GH0LjRgtGL0LLQsNC10Lwg0L/QvtCy0YLQvtGA0LXQvdC40Y8KICAgICAgICArK21bc1tpXV07CiAgICBmb3IgKGF1dG8gaXQgPSBtLmJlZ2luKCk7IGl0ICE9IG0uZW5kKCk7IGl0KyspIAogICAgICAgIGlmIChpdCAtPiBzZWNvbmQgPiAxKSBjb3VudCAqPSBmYWN0W2l0IC0+IHNlY29uZF07CiAgICBjb3V0IDw8IGZhY3RbbF0gLyBjb3VudDsgCiAgICByZXR1cm4gMDsKfQ==