using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        int n;
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int l = s.Length;
            int n = l;
            string sl = s.Substring(0, s.Length / 2);
            string sr = s.Substring(s.Length / 2 + s.Length % 2, s.Length/2);

            if (SortString(sl) == SortString(sr)) //ima ista slova sleve i sdesne
            {
                for (int i = 0; i < l / 2 + l % 2; i++)
                {
                    if (s[i] == s[l - i - 1])
                        n -= 2;
                    else
                        n--;

                    if (i == l - i - 1)
                        n++;
                }
            }
            else
            {
                bool b = true;
                for (int i = 0; i < l / 2; i++)
                {

                    if (s[i] == s[l - i - 1])
                        if (b)
                            n -= 2;
                        else
                        {
                            n -= 1;
                            b = false;
                        }
                    else if (b)
                    {
                        n--;
                        b = false;
                    }
                }
            }

            if (n == 0) n = 1;
            Console.WriteLine(n);
        }

        static string SortString(string input)
        {
            char[] characters = input.ToArray();
            Array.Sort(characters);
            return new string(characters);
        }
    }
}