A warehouse must confirm n delivery windows. Window i is the closed range [start_i, end_i] (both endpoints included). A single audit checkpoint scheduled at time t confirms every window whose range contains t. Find the minimum number of checkpoint times needed so that every one of the n windows contains at least one checkpoint.
Input format
Line 1: an integer n.
Next n lines: two integers start_i end_i describing window i (start_i <= end_i).
Output format
A single integer: the minimum number of checkpoints needed.
Constraints
- 1 <= n <= 8
- 0 <= start_i <= end_i <= 30