#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); string S; cin >> S; set st; function dfs = [&](string s, int l, int r, int d) { if (d == (int)S.size()) { st.insert(s); return; } dfs(s + S[l], l + 1, r, d + 1); dfs(s + S[r], l, r - 1, d + 1); }; dfs("", 0, (int)S.size() - 1, 0); cout << st.size() << '\n'; return 0; }