#C840. Minimum Number of Volunteers Required

    ID: 52378 Type: Default 1000ms 256MiB

Minimum Number of Volunteers Required

Minimum Number of Volunteers Required

You are given a set of tasks where each task is represented by an interval \([s_i, e_i]\) indicating its start time \(s_i\) and end time \(e_i\). Your goal is to determine the minimum number of volunteers required such that each task is covered. In other words, you need to find the maximum number of overlapping tasks at any given time.

Note: When tasks start and end at the same time, the task that ends is considered finished before a new one begins. This is crucial in determining the correct overlapping count.

Example: For tasks \((1, 3)\), \((2, 5)\), and \((4, 6)\), the maximum overlap is 2, so the answer is 2.

inputFormat

The first line contains a single integer \(n\) representing the number of tasks.

The following \(n\) lines each contain two integers \(s_i\) and \(e_i\) separated by a space, representing the start and end times of each task.

\(1 \leq n \leq 10^5\) and the time values are positive integers.

outputFormat

Output a single integer representing the minimum number of volunteers required to cover all the tasks.

## sample
3
1 3
2 5
4 6
2