#P188. 【例31.3】正常血压

【例31.3】正常血压

Description

In the intensive care unit, a patient's blood pressure is measured every hour. The blood pressure is considered normal if the systolic pressure is between 9090 and 140140 (inclusive) and the diastolic pressure is between 6060 and 9090 (inclusive). Given the blood pressure measurements of a patient over several hours, calculate the longest duration of consecutive hours during which the patient's blood pressure remained normal.

Input Format

The first line contains an integer nn (n<100n<100).
The next nn lines each contain two positive integers, representing the systolic and diastolic pressures of a measurement (both within the range [1,2001,200]), separated by a space.

Output Format

Output a single line containing the longest duration of consecutive hours during which the blood pressure remained normal.

Sample

4
100 80
90 50
120 60
140 90
2