P6355 [COCI 2007/2008 #3] DEJAVU

Description

Given $n$ points on a plane, compute how many different right triangles there are such that all their vertices are among the given points, **and both legs are parallel to the coordinate axes**. Two right triangles are different if and only if they have at least one different vertex.

Input Format

The first line contains an integer $n$, the number of points. The next $n$ lines each contain two integers, giving the coordinates of a point.

Output Format

Output the number of right triangles.

Explanation/Hint

#### Constraints - For $40\%$ of the testdata, it is guaranteed that $n