#include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main(){ string s; int ans = 0; cin >> s; deque dq; dq.push_back(s); while (!dq.empty()){ string tmp1, tmp2, tmp3; tmp3 = dq.front(); dq.pop_front(); tmp1 = tmp2 = tmp3; tmp2.pop_back(); tmp1 = tmp1.substr(1); if (tmp1 == tmp2){ if (tmp1.size() == 1) ans++; else dq.push_back(tmp1); } else { if (tmp1.size() == 1) ans += 2; else { dq.push_back(tmp1); dq.push_back(tmp2); } } } cout << ans << endl; }