#include<iostream>
#include<string>
using namespace std;
int main()
{
string a;
getline(cin, a);
int L = a.length();
int max = 1;
int i, j, t;
t = 0;
while (t < L)
{
i = t - 1;
j = t + 1;
while (i>=0&&j<L)
{
if (a[i] == a[j])
{
if (j - i + 1 > max)
max = j - i + 1;
i--;
j++;
}
else
break;
}
i = t;
j = t + 1;
while (i >= 0 && j<L)
{
if (a[i] == a[j])
{
if (j - i + 1 > max)
max = j - i + 1;
i--;
j++;
}
else
break;
}
t++;
}
cout << max << endl;
system("pause");
return 0;
}