#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;
}