403390: GYM101149 E The Best among Equals
Description
A university in Samara has held a qualification contest in figure programming, but the jury can't come to terms how many teams should take part in the next stage of the contest. In figure programming a judge system doesn't evaluate the scores precisely and just set an interval which the score can belong to. Jury is able to evaluate any participant with any score from this interval. There are n teams that took part in the contest, and the i-th of them has the score in the interval from li to ri, inclusively. Jury wants the number of qualified teams to be as large as possible, but they have to get the maximal score among all teams. What is the maximal number of teams that can take part in the next stage of the contest under such circumstances?
InputThe first line contains a single integer n (1 ≤ n ≤ 2·105) — the number of teams in the contest.
Each of the next n lines contains two space-separated integers: li and ri ( - 109 ≤ li ≤ ri ≤ + 109) — the lower and upper bounds of the score for the i-th team.
OutputOutput a single integer — the maximal number of teams that can get the maximal score.
ExampleInput3Output
1 3
2 4
4 5
2