Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/while-bir-xil-raqamlar-qatori

Longest run of equal digits

Medium 1000 ms 64 MB 51%
Share

A positive integer $n$ is given. Find the length of the longest part of its notation consisting of consecutive equal digits.

The longest stretch of equal digits in the notation of the number

Input

One positive integer $n$.

Output

One integer — the length of the longest run.

Note

$1 \le n \le 10^{18}$

Examples

Input #1
1222553
Output #1
3
Input #2
12345
Output #2
1

Sign in to submit a solution

Signing up is free and takes a minute.