#include #include using namespace std; string S; void dfs(const string& S, set* str_set, int l, int r, const string& cur) { if (l == r) { str_set->insert(cur + S[l]); } else { dfs(S, str_set, l + 1, r, cur + S[l]); dfs(S, str_set, l, r - 1, cur + S[r]); } } int main() { cin >> S; set str_set; dfs(S, &str_set, 0, S.length() - 1, ""); cout << str_set.size() << endl; return 0; }