Consider distinct points on a plane.
Two points from this set are called friends if there exists a rectangle with sides parallel to the coordinate axes that contains these two points and contains no other points from the set. A rectangle is said to contain a point if the point lies within the rectangle or on its border.
How many pairs of friends are there among the given points?
The first line contains an integer (1 \leq n \leq 100\,000).
Each of the next lines contains two integers, the coordinates of a point. The absolute value of each coordinate does not exceed 10^9.
Output one integer — the number of pairs of friends.
Example 1