Max has a special vanishing pencil that helps vanish line segments on X-axis. For example , if one line segment is from (1,0) to (4,0) and another one is from (3,0) to (7,0) , Max can touch his pencil on either (3,0) or (4,0) to vanish these two lines- so only 1 try is enough.
Input :
first line gives how many line segments
next line starting points of line segments
next line ending points of line segments
Output:
how many attempts to remove all the line segments/points
Example:
4
0 2 4 -8
4 5 6 -9
Expected Ouput
2
Explanation :
On putting the pencil on 4 , first three line segments will disappear. Remaining point -8,-9 will be removed in next trial.