#include<stdio.h>
#include<string.h>
#include<stdbool.h>
 
bool palindrom(char *T)
{
    int len = strlen(T);
 
    if (len == 1)
        return true;
 
    char *ptr1 = T;
 
    char *ptr2 = T+len-1;
 
    while (ptr2 > ptr1)
    {
        if (*ptr1 != *ptr2)
            return false;
        ptr1++;
        ptr2--;
    }
 
    return true;
}
 
int br_dodataka(char T[])
{
    if (palindrom(T))
        return 0;
    T++;
    return 1 + br_dodataka(T);
}
 
int main()
{
    char T[60];
    gets(T);
    printf("%d\n", br_dodataka(T));
    return 0;
}