#d1507. 测温

测温

Temperature Measurement

Problem Description

A country measured the temperature for nn consecutive days. Each measurement has some error: the result of the ii-th day's measurement says the temperature lies in the range [li,ri][l_i, r_i]. Find the length of the longest consecutive run of days over which the temperature is non-decreasing.

Input Format

The first line contains an integer nn (1≤n≤1061\le n \le 10^6).

The following nn lines each contain two numbers li,ril_i, r_i (−109≤li≤ri≤109-10^9 \le l_i \le r_i \le 10^9).

Output Format

One line containing the length of such a run.

Sample Input

6
6 10
1 5
4 8
2 5
6 8
3 5

Sample Output

4