using System;

namespace Palindrom_safl
{
    class Program
    {    
        static void Main(string[] args)
        {
            string T = Console.ReadLine();
            int br1 = 0, br2 = 0, br = 0; bool b = false;
            int j = T.Length - 1; 
            for (int i = 0; i< T.Length/2 ; i++, j--)
            {
                if (T[i] != T[j] ) 
                { br1++; --i; b = true; }
                else if (T[i] == T[j] && b) { br1++; b = false; }
                if (j <= i) break;
            }
            for (int i = 0; i < T.Length / 2; i++, j--)
            {
                if (T[i] != T[j])
                { br2++; ++j; b = true; }
                else if (T[i] == T[j] && b) { br2++; b = false; }
                if (i >= j) break;
            }
            if (br1 > br2) br = br2;
            else br = br1;
            if (br == 0) br++;
            Console.WriteLine(br);           
        }
    }
}