One day Bajtazar went to the market square in Bajtogród to play the banjo. So as not to bother the nearby residents too much, he decided to play only two short one-minute songs. Even so, Bajtazar wanted as many people as possible to hear him, so he played one song, waited a little while, and then played the second one. Now he wonders whether, by chance, even more people could have heard his performance.
During the day, n people passed through the square, numbered from 1 to n. Person number i arrived at the square exactly at the start of minute pi (counting from dawn) and left the square at the start of minute ki.
Bajtazar would like to compute how many people at most could hear him play if he started his performances at the best possible moments. This task, however, exceeded his arithmetic skills, since a day here lasts 109 minutes. Please help him.
Assume Bajtazar plays exactly twice, each time for one minute. Each performance may start at any time; in particular, the second song may start right after the first one ends. A given person hears a performance if they are present in the square for the entire minute during which Bajtazar plays.
The first line contains a single integer n (1≤n≤500000), the number of people who came to the square during the day. Each of the next n lines describes one person: the i-th of these lines contains two integers pi and ki (1≤pi≤ki≤109), meaning that person number i arrived at the start of minute pi and left at the start of minute ki.
Print a single line with the maximum number of distinct people who can hear Bajtazar's banjo performances.
In the first sample above, Bajtazar can play his first song during minute 5, when persons 1, 2, and 4 are present, and his second song during minute 9, when persons 2, 3, and 7 are present. Together, 5 distinct people hear him play.