#include <iostream>
using namespace std;
int main ()
{   string p;
    cin>>p;
    int n=p.length();
    for (int i=0;i<=n/2;i++){
        if(p[i]!=p[n-i])
            cout<<(n-i-1)/2+1;
            break;
    }
    return 0;
}