Task
Alessandro is a famous juggler and everyone loves him. He was asked to organize multiple shows, and he needs some help scheduling them.
Alessandro needs to take part in different shows, numbered from to . Each show must be assigned a day in which he performs it.
Show starts at a specific time and ends at a specific time of its assigned day.
He has to decide the day to perform each show, note that Alessandro can decide to perform each show on a different day, so the intervals are allowed to overlap.
Alessandro can perform two shows in the same day if the first show ends exactly at the time when the second show starts. Formally, he can perform shows and on the same day if . He can also perform three or more shows in the same day if the first show ends exactly when the second shows starts, the second show ends exactly when the third shows start, and so on. He may schedule the shows in any order.
Note that he can't perform two shows in the same day if the first show ends strictly before the second show starts and there are no shows between.
What is the minimum number of days Alessandro needs to perform every show? Note that Alessandro can always perform every show in at most days by assigning each show a different day.
Input
The first line contains a single integer (), the number of shows.
The following lines contains two integers each: and () for each .
For tests worth points, there is at most one pair of shows that can be performed in the same day.
For tests worth more points, () and ().
Output
You need to write a single line with an integer: the minimum number of days Alessandro needs to perform every show.
Example 1
stdin
4
4 9
2 4
9 12
1 4
stdout
2
Example 2
stdin
5
1 5
4 5
5 8
5 9
1 9
stdout
3
Notes
In the first sample case Alessandro can perform shows , and in first day and show in the second day.
In the second sample case, there are multiple solutions, all of which takes three days. For example, a possible solution is to perform shows and in the first day, in the second day and and in the third day.