eolymp
bolt
Try our new interface for solving problems
Problems

1 VS 1

1 VS 1

Time limit 1 second
Memory limit 64 MiB

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 'A', if Bob does this, of course, we will write down the letter 'B'. Tell me the length of the longest operation combo performed by either player.

Input data

There are several test cases, each test case contains only a string composed of uppercaser 'A' and 'B'. The input will finish with the end of file. The length of the string is no more than 1000.

Output data

For each the case, output an integer indicate for the length.

Examples

Input example #1
AAABBAAAAA
AABBBBAA
AAAAAAAA
Output example #1
5
4
8
Source Hunan University 2011 the 7th Programming Contest