P17697 [HackerEarth] Limak is a little polar bear, who isn't afraid of geometry.
提高-
题目描述

Limak is a little polar bear, who isn't afraid of geometry.
He has $n 2-dimensional non-zero vectors \vec{a_1}, \vec{a_2}, \ldots, \vec{a_n}$, each described by two integers x_i, y_i.
Show him that you can count ways to choose an ordered triple of distinct indices i, j, k satisfying the two conditions:
$\vec{a_i}$ is perpendicular to $\vec{a_j} + \vec{a_k}$
$\vec{a_j}+\vec{a_k} \ne 0$

If you don't know vectors (so you don't understand what is written above) then you can use the following three conditions, equivalent to those given above:
For fixed i, j, k let A, B, S denote points (x_i, y_i), (x_j + x_k, y_j + y_k), (0, 0) respectively.
$\measuredangle ASB = 90^{\circ}$
$B \ne S$

Input format
The first line contains one integer n — the number of vectors.

The i-th of next n lines contains two integers x_i, y_i — coordinates of $\vec{a_i}$.

Some of n vectors may be equal to each other but none of them is equal to $\vec{(0, 0)}$.

Output format
In one line print the number of ordered triples of distinct indices i, j, k satisfying the given conditions.

Constraints

3 ≤ n ≤ 3000
|x_i|, |y_i| ≤ 10^9

SAMPLE INPUT
5
1 1
1 0
2 -1
-2 1
1 0

SAMPLE OUTPUT
4

Explanation

There are n = 5 vectors in the sample test.
Note that some of them may be equal.
There are 4 ways to choose a triple of indices:
$(1, 2, 4) because \vec{a_1} = \vec{(1, 1)}$ is perpendicular to $\vec{a_2} + \vec{a_4} = \vec{(1-2, 0+1)} = \vec{(-1, 1)}$
(1, 4, 2)
(1, 4, 5)
(1, 5, 4)

输入格式

见题面

输出格式

见题面

样例输入
200 -4 -2 -1 8 -4 -4 3 -1 4 6 2 3 -6 -5 3 2 -10 -4 -1 6 1 -7 -4 7 -6 -3 -10 -3 4 3 9 3 -9 7 9 -1 -3 3 5 3 -6 1 -8 -3 -1 10 1 4 -10 -10 -4 6 -8 -7 5 5 10 9 3 -10 -1 4 0 4 10 8 -3 -9 -6 2 0 -3 8 10 -7 7 6 7 10 7 2 8 -8 -10 7 -9 -9 -2 9 7 1 7 8 10 -1 6 -9 8 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