def f(L): N = len(L) temp = [None] * N for i in range(N): temp[i] = L[N - 1 - i] return L == temp S = list(input()) M = len(S) ans = 1 for i in range(M): for j in range(i + 1, M): if j - i == M - 1: continue if f(S[i:j+1]): ans = max(ans, j + 1 - i) print(ans)