# -*- coding: utf-8 -*- def ch(S): N = len(S) SR = S[:] SR.reverse() if S == SR: return N else: return 0 S = list(raw_input()) N = len(S) cntmax = 0 if len(S) == 2: print 1 exit() for i in range(0, N-1): for j in range(i+1, N+1): tmp = ch(S[i:j]) if cntmax < tmp: cntmax = tmp print cntmax