#P1018. 重复片段 (Repetitions)

重复片段 (Repetitions)

Source: CSES Problem Set (Task 1069)
Link: https://cses.fi/problemset/task/1069
Category: Introductory Problems

  • Time limit: 1.00 s
  • Memory limit: 512 MB

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 nn characters.

Output

Print one integer: the length of the longest repetition.

Constraints

  • 1≤n≤1061 \le n \le 10^6

Example

Input:

ATTCGGGA

Output:

3