while True: try: s = input() res = '' for i in range(len(s)): start = max(0, i - len(res) - 1) tmp = s[start: i+1] if tmp == tmp[::-1]: res = tmp else: tmp = tmp[1:] if tmp == tmp[::-1]: res = tmp print(len(res)) except: break
while True: try: s = input() res = '' for i in range(len(s)): start = max(0, i - len(res) - 1) tmp = s[start: i+1] if tmp == tmp[::-1]: res = tmp else: tmp = tmp[1:] if tmp == tmp[::-1]: res = tmp print(len(res)) except: break