#T340. 活动选择
活动选择
Description
The school has events scheduled over the next few days, all of which require the use of the school auditorium. At any given time, the auditorium can only be used by one event. Due to scheduling conflicts, the school office staff has no choice but to have some events give up using the auditorium and use other classrooms instead.
Given the start time and end time () for each of the events, please help the office staff arrange as many events as possible to use the auditorium.
Input Format
The first line contains an integer ();
The next lines each contain two integers: the first is , and the second is ().
Output Format
Output the maximum number of events that can be scheduled.
11
3 5
1 4
12 14
8 12
0 6
8 11
6 10
5 7
3 8
5 9
2 13
4