using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SpaceEscape { class Program { static void Main(string[] args) { string target = Console.ReadLine(); Console.WriteLine(checkAnagram(target)); } static int checkAnagram(string str) { int max_count = 0; // max count for anagram word for (int i = 0; i < str.Length; i++) { int count = 0; // count for anagram word for (int j = 1; j < str.Length; j++) { if (i + j >= str.Length || i - j < 0) break; if (str[i + j] == str[i - j]) count++; } if (max_count < count) max_count = count; } return max_count * 2 + 1; } } }