While sorting through his childhood toys, Stepan discovered a collection of unique rectangles and recalled a problem his old math teacher once posed to him. We define a rectangle as small if there exists another rectangle in the set that can completely cover it. The rectangles can be rotated, but their sides must remain parallel.
For instance, a rectangle with sides and can be fully covered by a rectangle with sides and , but not by a rectangle with sides and . Rectangles with sides and , as well as those with sides and , cannot be covered, so in this set of three rectangles, only one is considered small. Write a program to solve the problem Stepan remembered: determine the number of small rectangles in the given set.
The first line of the input contains a single integer (2 \le N \le 200000). Each of the following lines contains two positive integers representing the dimensions of one rectangle. All dimensions do not exceed . There are no identical rectangles in the set.
The output should be a single integer representing the number of small rectangles in the given set.
Beispiel 1