Олимпиадный тренинг

Задача 42840. Signals from space


Задача

Темы: Циклы
Professor Seleznev analyzes signals from space. It logs the signal intensity every second as an integer. He does this until the signal fades. Therefore, each record of his observations ends with the number 0. Now he would like to know the maximum time duration of a signal of the same intensity. Seleznev can observe signals for quite a long period of time and it will be quite difficult for him to manually calculate the maximum duration of such a signal. Help him determine this time period.

Input
The input to the program is integers, one number per line. The last line contains the number 0. (Number 0  -  sign of its end).

Imprint
The maximum duration in seconds of a signal of the same intensity.
 
 
Examples
# Input Output
1 2
2
2
3
3
1
1
1
1
0
4