s=raw_input() l=len(s) r=range print max(max(j+1for j in r(l-max(i,1))if s[i:i+j+1]==s[i+j:i-1-l:-1])for i in r(l))