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:
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.
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.
A single integer, the number of sets of stars that form a valid cross.
70 01 11 -12 03 13 -14 0
4
61 03 13 -14 04 26 1
1
51 03 13 03 -14 0
1
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$$$.