#include #include #include using namespace std; set str; void dfs(string S,string T); main(){ string S,T; cin >> S; dfs(S,T); cout << str.size() << endl; } void dfs(string S,string T){ if(S.empty()){ str.insert(T); return; } dfs(S.substr(1,S.size()-1),T+S[0]); dfs(S.substr(0,S.size()-1),T+S[S.size()-1]); }