|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||256 MB||3||3||3||100.000%|
Zhomart likes watching the stars and construct a variety of geometric shapes from them. The sky is represented in the form of the Cartesian coordinate system, and the stars are represented by points on it. At this moment Zhomart interested in the question: how many different right triangles whose legs are parallel to the axes, you can create with the help of stars in the sky.
In the first line of the input line you are given N –– the number of stars on the sky (3 ≤ N ≤ 300000). Each of the next N lines contains integer X and Y (|X, Y| ≤ 109) –– coordinates of the appropriate star.
Print one number – the answer to the question.
3 0 0 1 0 0 1
4 0 0 1 0 0 1 1 1