s = input() ans = 1 for i in range(len(s)): for j in range(i+1, len(s)+1): if j - i < ans or (i == 0 and j == len(s)): continue else: if s[i:j] == s[i:j][::-1]: ans = j-i print(ans)