403790: GYM101306 C Art Museum
Description
EPFL (Extreme Programmers For Life) want to build their 57th art museum. This museum would be better, bigger and simply more amazing than the last 56 museums. This would make EPFL great again.
To achieve this, EPFL will not only require the help of top-notch Japanese architects, but also of all Martians. However, the Martians are spread across several galaxies and therefore have different time availabilities. You thought the time difference between Europe and USA was annoying?
Help EPFL find the maximum number of galaxies that are available at the same hour?
InputThe first line contains the integer n, the number of galaxies (1 ≤ n ≤ 105).
On each of the next n lines, there will be two space-separated integers, a and b (0 ≤ a < b ≤ 24).
This means that the Martians of this galaxy are available from the beginning of the a-th hour to the beginning of the b-th hour.
OutputPrint the maximum number of galaxies available in any timeslot of one hour.
ExamplesInput2Output
1 14
14 21
1Input
7Output
9 16
16 18
5 12
15 24
9 20
20 22
23 24
3Note
In the first example, the Martians of the first galaxy are available from 01:00 to 14:00, and the Martians of the second galaxy are available from 14:00 to 21:00. Therefore, at any given hour, the maximum number of available galaxies is 1.
In the second example, the timeslots in which 3 galaxies are available are: 9:00 - 12:00, 15:00 - 16:00, and 16:00 - 18:00. No one-hour timeslot has more than 3 galaxies available. Therefore, the answer is 3.