eolymp
bolt
Попробуйте наш новый интерфейс для отправки задач

1 VS 1

Alice and Bob are playing the game SanguoSha 1VS1. If Alice take a card or use a card (it may be slash, missed, peach, duel, sabotage or theft and so on) or discard (sometimes he does not need to throw any card) we will write down an uppercase '\textbf{A}', if Bob does this, of course, we will write down the letter '\textbf{B}'. Tell me the length of the longest operation combo performed by either player. \InputFile There are several test cases, each test case contains only a string composed of uppercaser '\textbf{A}' and '\textbf{B}'. The input will finish with the end of file. The length of the string is no more than \textbf{1000}. \OutputFile For each the case, output an integer indicate for the length.
Лимит времени 1 секунда
Лимит использования памяти 64 MiB
Входные данные #1
AAABBAAAAA
AABBBBAA
AAAAAAAA
Выходные данные #1
5
4
8
Источник Hunan University 2011 the 7th Programming Contest