#000031

kvadrati

Professor Djuric, the editor of the famous magazine "Secant", has an interesting ability that made him famous all around the world. When given any number of coplanar points, he only needs to take a glance at them to determine how many squares they form. Only a small number of people knows the professor's secret. The secret is that he uses his pocket computer to find the squares. But, alas! The professor has accidentally deleted his program! Please help him so he can still be famous! Your task is to write a program that determines how many squares are formed by N points in a plane, given their x and y coordinates.


InputThe first line of the standard input contains one integer, N (0<N<=1000), the number of points. In the next N lines, there are two integers, xi and yi (-10000<= xi , yi <=10000), the coordinates of the i-th point (1<=i<=N).

OutputThe standard output should contain only one number, the number of squares formed by the given points.

Input:
6
0 0
1 0
0 1
1 1
2 1
1 2

Output:
2

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.