The farm has suffered an extraordinary amount of rain lately. Now wanting to eat free from rain, the ingenious cows have set up $N$ ($1 \le N \le 25{,}000$) rectangular umbrellas to shield them from the rain while they are grazing.
The cows' field is a single strip of grass, and each umbrella completely covers some interval of grass. However, they have set up the umbrellas in a most haphazard way, and some of the umbrellas cover all or part of an area covered by one or more other umbrellas. Your task is to find the greatest number of umbrellas whose areas are completely covered by a single umbrella.
Input
- Line 1: The single integer $N$
- Lines $2..N+1$: Two space-separated integers, $A$ and $B$ ($1 \le A < B \le 2{,}000{,}000{,}000$) that are the endpoints of the interval of grass covered by an umbrella. No endpoint is shared by any two umbrellas.
Output
- Line 1: A single integer that is the maximum number of umbrellas whose coverage is entirely within the area covered by another single umbrella.
Examples
Input 1
4
1 7
2 3
5 6
4 10
Output 1
2
Output Details
The first umbrella covers the second and third umbrellas, as seen below:
*-----------*
| |
*-----------*
| |
| *-* *-* |
| | | | | |
1 2 3 4 5 6 7 8 9 10
Problem credits: Alex Schwendner, 2003