HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


Repetitions

Section problems

• Divisors count
• GCD of ones
• Prime numbers
• Set cover problem
• Shopping
• Corridor
• D. Love-Hate
• Ferris Wheel
• Repetitions
• Weird Algorithm
• Bit Strings
• Distinct Numbers
• Missing Number
• Increasing Array
• Coin Piles
• Josephus Queries
• Apartments

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb. Difficulty Alpha


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≤n≤106

Example
Input:
ATTCGGGA

Output:
3

Для отправки решений необходимо выполнить вход.

www.contester.ru