Segments are given on a line. What is the maximum number of segments that can be selected so that no two of them intersect? The segments are considered open.
The first line contains the number of segments . The next lines describe the segments: the -th line contains two integers and — the coordinates of the starting and ending points of the segment.
Print the maximum number of non-intersecting segments.