s = input() maxl = 1 for i in range(len(s)): for j in range(i,len(s)): s_part = s[i:j+1] if s_part == s_part[::-1]: maxl = max(maxl,(len(s_part))) print(maxl)