S = input() ans = 0 left = 0 while left < len(S): right = left while right < len(S) and S[right] == S[left]: right += 1 if ans < right - left: ans = right - left left = right print(ans)