firstNumber = secondNumber = 1
currentCount = maxCount = 0
while firstNumber * secondNumber != 0:
firstNumber, secondNumber = map(int, input().split())
if firstNumber == secondNumber:
currentCount += 1
else:
maxCount = max(maxCount, currentCount)
currentCount = 0
print(maxCount)