Question
Auditorium Event Planner
A college auditorium receives
Your task is to find the maximum number of events that can be hosted.
Input
The first line contains an integer KaTeX can only parse string typed expression — the number of event requests.
Each of the next KaTeX can only parse string typed expression lines contains two integers KaTeX can only parse string typed expression and KaTeX can only parse string typed expression — the start and end time of an event.
Output
Print a single integer — the maximum number of events that can be hosted.
Example
Example 1:
Input
Events KaTeX can only parse string typed expression, KaTeX can only parse string typed expression, and KaTeX can only parse string typed expression can all be hosted.
Example 2:
Input
Input
4
1 3
2 4
3 5
5 6Output3ExplanationEvents KaTeX can only parse string typed expression, KaTeX can only parse string typed expression, and KaTeX can only parse string typed expression can all be hosted.
Example 2:
Input
5
1 10
2 3
3 4
4 5
5 6Output4