#include #define show(x) cout << #x << " = " << x << endl using namespace std; using ll = long long; using pii = pair; using vi = vector; template ostream& operator<<(ostream& os, const vector& v) { os << "sz=" << v.size() << "\n["; for (const auto& p : v) { os << p << ","; } os << "]\n"; return os; } template ostream& operator<<(ostream& os, const pair& p) { os << "(" << p.first << "," << p.second << ")"; return os; } constexpr ll MOD = 1e9 + 7; template constexpr T INF = numeric_limits::max() / 100; int main() { string s; cin >> s; const int n = s.size(); unordered_set st; const int maximum = 1 << n; for (int i = 0; i < maximum; i++) { int head = 0; int tail = n - 1; int num = i; string news; for (int j = 0; j < n; j++) { if (num % 2 == 1) { news.push_back(s[head]); head++; } else { news.push_back(s[tail]); tail--; } num /= 2; } if (st.find(news) == st.end()) { st.insert(news); } } cout << st.size() << endl; return 0; }