using System; namespace Yuki { class Program { static void Main(string[] args) { string s = Console.ReadLine(); string a; int max = s.Length == 2 && s[0].Equals(s[1]) ? 1 : 0; for (int i = 0; i < s.Length; i++) { a = s[i].ToString(); for (int j = i + 1; j < s.Length; j++) { a += s[j]; if (a.Length == s.Length) break; char[] b = a.ToCharArray(); Array.Reverse(b); if (a.Equals(new string(b))) max = Math.Max(max, a.Length); } } if (max == 0) { max = 1; } Console.WriteLine(max); Console.ReadLine(); } } }