Triangles
Time limit3sMemory limit512 MB
Given n distinct points, count the triples that form a non-degenerate isosceles triangle (at least two equal sides).
Problem
Petya has been attending a math club for quite a while, so he has already learned not only the rules for basic operations but also a rather difficult concept: symmetry. To study symmetry better, Petya decided to start with the simplest geometric figures, triangles. He soon realized that the figures with axial symmetry are the so-called isosceles triangles. So now Petya looks for such triangles everywhere.
Recall that a triangle is isosceles if its area is positive and it has at least two equal sides. Recently, when Petya walked into his classroom, he saw n points drawn on the blackboard. Naturally, he immediately wondered how many triples of these points are the vertices of isosceles triangles.
You must write a program that solves this problem.
Input
The input file contains an integer n (3 ≤ n ≤ 1500). Each of the following n lines contains two integers xi and yi, the coordinates of the i-th point. The absolute value of each coordinate does not exceed 109. No two given points coincide.
Output
Output the answer to the problem to the output file.