Ice-T has remained a powerful player in the rap game for almost forty years, ever since his debut in the early 80's. It is a little known secret that Ice-T powers his incredible rapping abilities by amassing points in a 2D plane and harvesting all of the 'T's that he can find among them.
A 'T' is defined to be a set of four points $$$A$$$, $$$B$$$, $$$C$$$, and $$$D$$$ where:
Help Ice-T become even more powerful! Given a set of $$$N$$$ points in 2D space, find the number of 'T's present.
The first line of input contains a single integer $$$N$$$ ($$$1 \leq N \leq 1000$$$), the number of points in the 2D plane that Ice-T has already amassed. $$$N$$$ lines follow, each containing two space-separated integers $$$x_i$$$ and $$$y_i$$$ ($$$0 \leq x_i, y_i \leq 10^9$$$) which give the coordinate location of a unique point in the plane.
Output the total number of unique 'T's contained within the given points.
Note that a single point can contribute to multiple 'T' sets. Additionally, any orientation of a 'T' (vertical, horizontal, or upside-down) is acceptable to Ice-T, so include them all in your total.
11 5 10 7 6 7 4 7 2 1 8 3 8 1 6 3 6 2 4 2 6 5 8
3