#include #include using namespace std; string S; set all; void dfs(int L, int R, string acc){ if(L > R){ all.insert(acc); return; } dfs(L + 1, R, acc + S[L]); dfs(L, R - 1, acc + S[R]); } int main(){ cin >> S; dfs(0, (int)S.size() - 1, ""); cout << all.size() << endl; return 0; }