#import"bits/stdc++.h" #define ALL(a) (a).begin(),(a).end() using namespace std;int main(){string s;cin>>s;sort(ALL(s));sete;do e.insert(s);while(next_permutation(ALL(s)));cout<