#C8808. Longest Consecutive Repetition
Longest Consecutive Repetition
Longest Consecutive Repetition
Given a string s
, determine the length of the longest consecutive sequence of identical characters within the string.
For example, consider the string aaabbcccddeeee
. The longest sequence is the four 'e' characters, so the answer is \(4\).
If the string is empty, the answer is \(0\).
Your program should read the input from standard input and output the result to standard output.
inputFormat
The input consists of a single line containing the string s
. The string can be empty. It is read from standard input.
outputFormat
Output a single integer which is the length of the longest consecutive repetition of a character in the input string. The result should be printed to standard output.
## sampleaaabbcccddeeee
4