Problem7477-- [CSES Problem Set] Repetitions

7477: [CSES Problem Set] Repetitions

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 256 MiB

Description

You are given a DNA sequence: a string consisting of characters A, C, G, and T. Your task is to find the longest repetition in the sequence. This is a maximum-length substring containing only one type of character.

Input

The only input line contains a string of $n$ characters.

Output

Print one integer: the length of the longest repetition.

Constraints

$1 \leq n \leq 10^6$

Sample 1 Input

ATTCGGGA

Sample 1 Output

3
最长的为 GGG,长度为 $3$。

HINT

相同题目:CSES 1069

Source/Category