#include #include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main() { string s; int max1 = 1; cin >> s; int n = s.size(); for (int i = 0; i < n-1; i++){ for (int j = n-1; j > i; j--){ bool par = true; int f = i, b = j; if (f == 0 && b == n-1) continue; while (f <= b){ if (s[f++] != s[b--]) { par = false; break; } } if (par) max1 = max(max1, j-i+1); } } cout << max1 << endl; }