## Hardcore Grinding

View as PDF

Points: 5
Time limit: 2.0s
Memory limit: 256M

Author:
Problem types

friendly304010 really likes to grind (and somehow she manages it well), but can she finish all her tasks, just by herself? The answer, is sadly no. During the grade 9 year, she was doing fine, but in terms of computer science, she seems to be lacking a bit behind in her homework.

In order to combat this, she has machines to do the work for her! She has tasks (computer contest homework), and she wants to know how many machines she needs to complete the task, as each machine costs quite a fortune. Each task has a start time and an end time , each machine cannot do more than task at a time.

friendly304010 is stuck on the problem. You, as her trusty programmer, shall help her and solve her dilemma.

#### Input Specification

First line , denoting the number of tasks that friendly304010 needs to do.

Next lines, integers and , denoting the start time and finish time of the task. The tasks are sorted in order by start time.

#### Output Specification

Output one integer, the total number of machines that are required to finish all tasks, such that each machine does only task at a time.

#### Sample Input

7
1 3
1 4
2 5
3 7
4 7
6 9
7 8

#### Sample Output

3