One meeting room is shared by many meetings, each with a start and end time; a meeting may start exactly when another ends. Choose the maximum number of non-overlapping meetings and print that count.
Input
Line 1: $N$. Next $N$ lines: start $S$ and end $E$ ($S < E$).
Output
Print the maximum number of meetings.
Example 1
Input
6 1 4 3 5 2 6 5 7 3 8 7 9
Output
3
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.