There are n events. Event i runs from day start to day end inclusive, and you may attend it on any single day within [start, end]. You can attend at most one event per day, and each event can be attended at most once. Report the maximum number of events you can attend.
Input format
Line 1: an integer n.
Next n lines: two integers start end (with start <= end).
Output format
A single integer: the maximum number of events you can attend.
Constraints
- 1 ≤ n ≤ 100000
- 1 ≤ start ≤ end ≤ 1000000