# 暴力解法
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); string str; while (cin >> str) { int ans = 1; string t = "#"; for (auto & c : str) t = t + c + "#"; for (int i = 1; i < t.size() - 1; i++) { int l = 1; while (i - l >= 0 && i + l < t.size() && t[i - l] == t[i + l]) { ans = max(ans, l); l++; } } cout << ans << endl; } return 0; }