시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB611114.286%

문제

Given a set of points with integer coordinates $x_i, y_i$, $i = 1 \ldots N$, your program must find all the squares having each of four vertices in one of these points.

입력

Input file contains integer $N$ followed by $N$ pairs of integers $x_i$ $y_i$.

출력

Output file must contain a single integer -- number of squares found.

제한

  • $-10^4 \le x_i, y_i \le 10^4$, $1 \le N \le 2000$.
  • All points in the input are different. 

예제 입력 1

4 0 0 4 3 -3 4 1 7

예제 출력 1

1

예제 입력 2

9
1 1  1 2  1 3  
2 1  2 2  2 3  
3 1  3 2  3 3

예제 출력 2

6