cho.sh
Notes
Loading...

Longest Digit Run

Time limit

1s

Memory limit

128 MB

Problem

You are given three positive eight-digit integers. For each integer, find the maximum length of a contiguous run made of the same digit. If no equal adjacent digits appear, the answer is 1.

For example, 12345123 has no equal adjacent digits, so its answer is 1. In 17772345, the digit 7 appears 3 times in a row, so its answer is 3. In 22233331, the digit 2 appears 3 times in a row and the digit 3 appears 4 times in a row, so its answer is 4.

Input

The first through third lines each contain one positive eight-digit integer.

Output

For each given integer, output the longest length of consecutive equal digits, one answer per line in input order.