#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); string s; cin >> s; set S; string now = ""; auto dfs = [&](auto dfs,int l,int r) -> void { if(l == r){S.insert(now); return;} now += s.at(l); dfs(dfs,l+1,r); now.pop_back(); now += s.at(r-1); dfs(dfs,l,r-1); now.pop_back(); }; dfs(dfs,0,s.size()); cout << S.size() << endl; }