Given line segments, each with a starting and ending position on a number line, what is the maximum number of segments overlapped at a single point along the number line? A line segment is considered to overlap with a point if it starts before or on the point and ends after or on the point.
Input Specification
The first line will contain a single integer , the number of segments.
The next lines will contain two integers each, and , the starting and ending position of the -th line segment.
Output Specification
Output a single integer, the maximum number of line segments overlapping at a single point along the number line.
Subtasks
Subtask 1 [20%]
Subtask 2 [80%]
No additional constraints.
Sample Input 1
5
1 2
2 4
3 6
4 7
1 3
Sample Output 1
3
Explanation for Sample 1
On points and , the overlap of line segments occurs.
Sample Input 2
10
1 100
3 20
18 21
11 12
12 13
11 12
1 4
4 5
5 6
7 8
Sample Output 2
5
Comments