#2390. 最大的子串(Repetitions)

    ID: 2390 Type: FileIO (repet) 1000ms 256MiB Tried: 17 Accepted: 4 Difficulty: 9 Uploaded By: Tags>CSES Introductory Problems

最大的子串(Repetitions)

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.

Format

Input

The only input line contains a string of n characters.

Output

Print one integer: the length of the longest repetition.

Samples

ATTCGGGA
3

Limitation

  • 1n10610^6
  • Time limit: 1.00 s
  • Memory limit: 512 MB

Statistics

Related

In following contests:

Introductory Problems

陈国瑞测试

In following homework:

训练题单一