def solve(s,t): return sum(si==ti for si,ti in zip(s,s[::-1])) s = input() ans = 0 for i in range(len(s)): ans = max(ans,solve(s[i:],s[::-1])) print(ans)