A broadcast console holds n booked advertising slots. Slot i occupies the half-open interval [start, end); two slots clash if their intervals overlap over a stretch of positive length (slots that only touch at an endpoint do not clash). Cancel as few slots as possible so that no two remaining slots clash.
Input format
Line 1: an integer n.
Next n lines: two integers start end (with start < end).
Output format
A single integer: the minimum number of slots that must be cancelled.
Constraints
- 1 ≤ n ≤ 100000
- 0 ≤ start < end ≤ 1000000