Triangle

Time Limit: 5 Seconds    Memory Limit: 32768 KB

Given a set of points, your job is to calculate the number of right-angled triangle whose vertices belongs to the given set of points.

Input

The input consists of multiple tests. The first line of each test contains an integer N (1 <= N <= 1000) which indicates the number of points. The next N lines contain N point. Each point is represented by x and y coordinates separated by a space.

Output

For each input test, output the number of right-angled triangle whose vertices belongs to the given set of points in a single line.

Sample Input

3
0.0 0.0
1.0 0.0
0.0 1.0
4
0.0 0.0
1.0 0.0
2.0 0.0
0.0 1.0

Sample Output

1
2
Submit

Source: ZOJ Monthly, April 2003