S = input().strip() ans = "" for i in range(len(S)-1): for j in range(i+1,len(S)+1): if i==0 and j==len(S):continue a = S[i:j] b = a[::-1] if a==b and len(a)>len(ans): ans = a print(len(ans))