1462 Max’s point

Time Limit : 2000/1000 MS(Java/Others) | Memory Limit : 65536/32768 KB(Java/Others)

Submits : 0 | Solved : 0

Description

Given a set of points, say P, in two dimension. Define the subset of P, say S, as follows:
For any three points, say i, j, k, of  S, it holds that:
dis(i,j)= = dis(j, k)==dis(i,k)  (here dis(i,j) means the distance between poiny i and j)
It is your task to find the number of  S which just contains 3 points in it.

Input

Input contains multiple test data sets.
For each data set, first comes one integer n(1<=n<=1 000 000), the number of the points. Then n lines follow, each has two integer numbers x,y (fabs(x)<1000 000 000,fabs(y)<1000 000 000), the coordinates of that point. The points may be overlapped, but they are regarded as different points. Refer to Sample Input for details.
Input is terminated by EOF.

Output

For each test data set, one output data set should be generated as follow:
Output one integer per line presenting the number of subset S satisfying the conditions described above.

Sample Input

3
0 0
0 0
0 0
2
1 1
1 1
3
0 0
1 0
0 0

Sample Output

1
0
0

HINT


Source


[ Top ] | [ Submit ]