S = list(input()) l = len(S) -1 prev_count = 0 for i in range(l): count = 0 j = l if prev_count >= j - i + 1: break while i <= j: #print("i:",i,"j:",j) if S[i] == S[j]: if i == j: count += 1 else: count += 2 i += 1 j -= 1 #print(count) if prev_count < count: prev_count = count print(prev_count)