A city has n billboards. Billboard i is lit during the closed time interval [s, e] with s ≤ e. An inspector visits at chosen instants of time; billboard i is covered if at least one chosen instant t satisfies s ≤ t ≤ e (endpoints count as covered). You may choose any real-valued or integer instants.
Find the minimum number of inspection instants needed so that every billboard is covered by at least one instant.
Input format
Line 1: an integer n.
Next n lines: two integers s and e describing one billboard's closed lit interval [s, e].
Output format
A single integer: the minimum number of inspection instants required.
Constraints
- 1 ≤ n ≤ 100000
- 0 ≤ s ≤ e ≤ 1000000000