Workshop Scheduling
UPEEC has workshop slots, each with a start and end time, but only one hall. A workshop can start exactly when the previous one ends. What is the maximum number of workshops you can hold?
Input
, then lines start end (start < end).
Output
The maximum number of workshops.
Constraints
Sample 1
Input
3 1 3 2 5 4 6
Output
2
Sample 2
Input
4 1 2 2 3 3 4 1 4
Output
3