Given n segments of the form [l; r] where both endpoints are inclusive, you are asked to calculate the maximum number of segments that have no intersection.

Note that segments having their endpoints at the same coordinates are not considered to be intersecting.

Input

The first line of the input contains a single integer n (1 β€ n β€ ) - the number of segments.

The next n lines contain two space separated integers and .

Output

The program should print the maximum number of non-intersecting segments.