The longest segment of the same characters
Given a long string
s
, you are asked to find the longest contiguous sequence of characters that have the same value. Input
The only line of the input contains the string
s
(1 β€ |s| β€ ). Output
The program should print a single integer - the length of the longest contiguous sequence of the same characters.
Examples
Input | Output |
aabbbaaaacc | 4 |
hello | 2 |
Β
Constraints
Time limit: 2.4 seconds
Memory limit: 512 MB
Output limit: 1 MB