Special trianglesTo show his love, XORin takes XORina to the museum. Suddenly he sees a painting containing a XOY system with N black lattice points drawn on it. Because he always likes asking people unpleasant questions, XORin asks the tour guide how many special triangles can be formed using the black points from the painting. Help the tour guide answer XORin questions.
A special triangle has the following characteristics:
- Its vertices are black points on the painting.
- It's an iscosceles and right triangle at the same time.
- His cathetis are parallel with the system's axes.
InputThe first line contains N, the number of black points from the painting. The next N lines contain the coordinates of the black points.
OutputPrint the number of special triangles
Constraints1 ≤ N ≤ 100 000
The coordinates of the points are integer numbers smaller than 109+1