1249 - LL's cafe

Time Limit: 5s Memory Limit: 128MB

Submissions: 148 Solved: 49
Description
LL opens a new cafe and he knows N customers will come tomorrow and the time of their appearance and departure. LL wants to know how many seats he should buy in advance to hold all customers tomorrow at least. Note : 1. One seat can only hold one customer at any time. 2. Suppose A leave at time t, and B come at time t, then they can’t sit at the same seat.
Input
There are multiple cases ended with EOF. Every case is terminated with a blank line . The first number of each case is one number——N (1 <= N <= 100000). The following N lines each contains two positive integers si, ti (0 <= si <= ti <= 2000000000), meaning that the ith customer will come at time si and leave at time ti.
Output
For each test, output one line containing a single integer——minimum seats LL should buy.
Sample Input
3
1 2
2 5
2 3
Sample Output
3
Hint
Source