#include #include using namespace std; int main(){ set s; string str; cin >> str; const int STRSIZE = str.size(); for(int i = 0;i < (1 << (STRSIZE - 1));i++){ string tmp = ""; int f = 0,e = STRSIZE - 1; for(int j = 0;j < STRSIZE - 1;j++) (i >> j) & 1 ? tmp += str[f++] : tmp += str[e--]; tmp += str[f]; s.insert(tmp); } cout << s.size() << endl; }