#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
int main() {
string s;cin >> s;
int len = s.length();
int ans = 0;
sort(s.begin(),s.end());
do {
for(int i = 1;i<len;i++) {
if(s[i] == s[i-1]) break;
if(i == len-1) ans++;
}
}while(next_permutation(s.begin(),s.end()));
cout << ans << endl;
}
暴力大法大好哇
(`3´)

京公网安备 11010502036488号