#K46622. Longest Consecutive Character Group

    ID: 28018 Type: Default 1000ms 256MiB

Longest Consecutive Character Group

Longest Consecutive Character Group

You are given a string \( s \) consisting of lowercase English letters. Your task is to determine the length of the longest group of consecutive identical characters in \( s \).

A group is defined as a contiguous sequence in which the same character repeats one or more times. Formally, if \( s = s_1 s_2 \dots s_n \), find the maximum value of \( k \) such that for some index \( i \), \( s_i = s_{i+1} = \cdots = s_{i+k-1} \). It is guaranteed that \( 1 \leq |s| \leq 10^5 \).

Note: All formulas are in LaTeX format.

inputFormat

The input consists of a single line containing a string \( s \) of lowercase English letters. There are no extra spaces or extra lines.

\( 1 \leq |s| \leq 10^5 \)

outputFormat

Output a single integer representing the length of the longest group of consecutive identical characters in the string.

## sample
aaabbcccaaa
3