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

namespace ConsoleApplication24
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            List<char> l = new List<char>();
            foreach (char c in s)
            {
                l.Add(c);
            }
            int n = l.Count-1;
            int poc = 0;
            int poc1 = 0;
            for (int i = 0; i < l.Count/2+1; i++)
            {
                if (l[i] != l[n - i])
                {
                    if (poc == 0) poc = i;
                    else
                    {
                        poc1 = i;
                        
                    }
                }

            }
            Console.WriteLine(poc + " " + poc1);
            bool k = true;
            for (int i = poc; i <= poc1; i++)
            {
                k = false;
                for (int j = n - poc; j >= (n - poc1); j--)
                {
                    if (l[i] == l[j])
                    {
                        k = k || true;

                        break;
                    }

                }
                if (k == false) break;

           }
            if (k) Console.WriteLine(poc1-poc+1);
            else Console.WriteLine(l.Count-2*poc-1);
            //Console.ReadKey();


        }
    }
}