Hide

Problem F
Win Streak

The Colorado School of Mines football team is just off of another great season which saw them reach the Division II finals for the second year in a row.

Unfortunately, the team lost the finals, but the Orediggers still had a great season, going on the longest winning streak in school history with fourteen games across the regular season and the playofffs until the final game. (A winning streak is a sequence of chronologically consecutive games where a team scores more points than their opponent.)

Orediggers head coach Pete Sterbick has tasked you with analyzing the games of the other teams in the Rocky Mountain Athletic Conference (RMAC) to determine how long their longest winning streaks were.

Given the scores for all of the games that one particular team has played, Coach Sterbick wants to know the length of the longest winning streak for that team.

Input

The first line of input will be a single integer $1 \leq N \leq 10^4$, the number of games the team you are analyzing has played.

The next $N$ lines will each contain two integers $0 \leq S, T \leq 222$, representing the score of the team you are analyzing, and the score of the opposing team, respectively. The scores are given in chronological order.

Output

Output a single integer, the length of the longest sequence of consecutive games where the team you are analyzing scored more points than their opponent.

Sample Input 1 Sample Output 1
10
14 7
17 20
20 10
28 14
30 7
10 17
45 20
24 10
28 24
14 14
3

Please log in to submit a solution to this problem

Log in