#include #include #include #include #include using namespace std; using ll = long long int; #define REP(i, n) for(int i = 0; i < (int)(n); i++) #define ALL_INCLUDED_ENVIRONMENT template std::ostream& operator<<(std::ostream& o, const std::vector& v) { o << "{"; for (int i = 0; i < (int) v.size(); i++) o << (i > 0 ? ", " : "" ) << v[i]; o << "}"; return o; } template std::ostream& operator<<(std::ostream& o, const std::list& lst) { o << "{"; for (auto itr = lst.begin(); itr != lst.end(); itr++) o << (itr == lst.begin() ? "" : ", " ) << *itr; o << "}"; return o; } template std::ostream& operator<<(std::ostream& o, const std::pair& p) { o << "(" << p.first << ", " << p.second << ")"; return o; } int main() { // cin.tie(0); // ios::sync_with_stdio(false); string s; cin >> s; set > table; int n = s.size(); REP(bits, 1 << n) { list lst; string::iterator l = s.begin(); string::iterator r = s.end(); r--; REP(i, n) { if (bits & (1 << i)) { lst.push_back(*l); l++; } else { lst.push_back(*r); r--; } } // cout << lst << "\n"; table.insert(lst); } cout << table.size() << "\n"; return 0; }