#include #define rep(i, a) rep2 (i, 0, a) #define rep2(i, a, b) for (int i = (a); i < (b); i++) #define repr(i, a) repr2 (i, 0, a) #define repr2(i, a, b) for (int i = (b) - 1; i >= (a); i--) using namespace std; typedef long long ll; bool ispal(string s) { rep (i, s.length()) { if (s[i] != s[s.length() - 1 - i]) return false; } return true; } int main() { string s; cin >> s; int ans = 1; rep (i, s.length()) { rep2 (j, i, s.length()) { if (i == 0 && j == s.length() - 1) continue; if (ispal(s.substr(i, j - i + 1))) { ans = max(ans, j - i + 1); } } } cout << ans << endl; return 0; }