G. Galactic Southern Cross
time limit per test
5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

When your ship's Infinite Improbability Drive malfunctions and leaves you stranded on a custom-made planet built by the ancient engineers of Magrathea, it is hard not to panic a bit.

Looking up, you discover an immense artificial night sky filled with stars. You remember that on Earth, people grouped them into constellations, and you immediately identify four stars that remind you of the Southern Cross. Right away, you spot another one, and yet another.

For a set of stars to be considered a "New Southern Cross", it must satisfy all of the following conditions:

  • Four Points: The constellation consists of exactly four distinct stars.
  • Non-collinearity: No three stars in this set lie on the same straight line.
  • Perpendicular Intersection: These four stars can be joined to form two line segments: the shaft and the crossbar, which intersect each other perpendicularly ($$$90^\circ$$$).
  • Bisection: The intersection point of the segments lies at the midpoint of the crossbar.
  • Alignment: The stars forming the shaft must be aligned with the South Pole (which is located at $$$(0, 0)$$$), or $$$(0, 0)$$$ must be a point on that segment.

In the image, we can see examples of valid crosses (which form a New Southern Cross) marked with star vertices ($$$\star$$$). The others are invalid: crosses ($$$\times$$$) and triangles ($$$\blacktriangle$$$) do not satisfy Alignment, circles ($$$\circ$$$) and squares ($$$\small{\blacksquare}$$$) do not satisfy Perpendicular Intersection, and filled circles ($$$\bullet$$$) do not satisfy Non-collinearity.

You must count how many sets of stars form a New Southern Cross in the sky you are observing.

Input

The first line contains an integer $$$N$$$ ($$$1 \le N \le 10^{5}$$$), the number of stars.

The $$$i$$$-th of the following $$$N$$$ lines contains two integers $$$X_i$$$ and $$$Y_i$$$ ($$$-10^{4} \le X_i, Y_i \le 10^{4}$$$), the coordinates of the $$$i$$$-th star. It is guaranteed that no two stars have the same coordinates.

Output

A single integer, the number of sets of stars that form a valid cross.

Examples
Input
7
0 0
1 1
1 -1
2 0
3 1
3 -1
4 0
Output
4
Input
6
1 0
3 1
3 -1
4 0
4 2
6 1
Output
1
Input
5
1 0
3 1
3 0
3 -1
4 0
Output
1
Note

In the first example, the stars look like this:

There are four valid crosses, formed by the following sets of stars: $$$ABCD$$$, $$$ABCG$$$, $$$AEFG$$$, and $$$DEFG$$$.