ranjit-and-his-boss

Ranjit has been assigned a task by his boss he has to mark n integer points in a co-ordinate system 
which are all distinct and then calculate the number of regular quadrilaterals which are constructed with the
help of available points 
and its sides being parallel to the co-ordinate axes.
But he is very weak in programming and Mathematics.He asks you to solve this complex problem.

Constraints:

1 ≤ N ≤ 10^5

0 ≤ x,y ≤ 10^5

Input:

The first line of the input contains an integer N denoting the number of marked points then following "N" lines contain two integers x & y.

Output:

Output the required answer.

SAMPLE INPUT
6
0 0
0 1
1 1
1 0
2 0 
2 1

SAMPLE OUTPUT
2

Source: hackerearth | Difficulty: UNKNOWN_DIFFICULTY


Solutions: