#include #include #include #include #include #include #include #include #include #include #include #define repd(i,a,b) for (int i=(a);i<(b);i++) #define rep(i,n) repd(i,0,n) typedef long long ll; using namespace std; int inputValue(){ int a; cin >> a; return a; }; void inputArray(int * p, int a){ rep(i, a){ cin >> p[i]; } }; void inputVector(vector * p, int a){ rep(i, a){ int input; cin >> input; p -> push_back(input); } } template void output(T a, int precision) { if(precision > 0){ cout << setprecision(precision) << a << "\n"; } else{ cout << a << "\n"; } } string s; int main(int argc, const char * argv[]) { set ss; // source code cin >> s; rep(i, 1 << s.size()){ string ret = ""; int num = i; int first = 0; int last = (int)s.size() - 1; rep(j, s.size()){ if (num % 2 == 0) { ret.push_back(s[first]); first++; } else{ ret.push_back(s[last]); last--; } num >>= 1; } ss.insert(ret); } output(ss.size(), 0); return 0; }