#include <iostream>
#include <fstream>
#include <set>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;
const char iname[] = "triang.in";
const char oname[] = "triang.out";
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++ i)
const double eps = 1e-3;
const double pi = acos(-1);
inline double my_abs(const double z) {
if (z < 0) return -z;
return z;
}
bool compare(const pair <double, double>& a, const pair <double, double>& b) {
if (my_abs(a.first - b.first) < eps) {
if (my_abs(a.second - b.second) < eps)
return false;
else
return a.second < b.second;
}
return a.first < b.first;
}
set < pair <double, double>, bool(*)(const pair <double, double>&, const pair <double, double>&) > S(compare);
vector < pair <double, double> > P;
int liniar_search(const pair <double, double> p) {
FOR (i, 0, P.size())
if (my_abs(P[i].first - p.first) < eps && my_abs(P[i].second - p.second) < eps)
return 1;
return 0;
}
int find(double a, double b, double x, double y, double angle) {
double new_x = (x - a) * cos(angle) + (y - b) * sin(angle);
double new_y = -(x - a) * sin(angle) + (y - b) * cos(angle);
return liniar_search( make_pair(new_x, new_y) );
// return S.find( make_pair(new_x, new_y) ) != S.end();
}
double dist(pair <double, double>& a, pair <double, double>& b) {
return sqrt( (b.first - a.first) * (b.first - a.first) + (b.second - a.second) * (b.second - a.second) );
}
int main(void) {
ifstream in(iname);
int n;
in >> n;
FOR (i, 0, n) {
double x, y;
in >> x >> y;
S.insert( make_pair(x, y) );
P.push_back( make_pair(x, y) );
}
in.close();
sort(P.begin(), P.end());
int res = 0;
FOR (i, 0, n) FOR (j, i + 1, n) {
if (P[i].first == P[j].first) {
double new_x = dist(P[i], P[j]) * sqrt(3) / 2;
double new_y = dist(P[i], P[j]) / 2;
res += liniar_search( make_pair(new_x, new_y) );
// res += S.find( make_pair(new_x, new_y) ) != S.end();
new_x = -new_x;
res += liniar_search( make_pair(new_x, new_y) );
// res += S.find( make_pair(new_x, new_y) ) != S.end();
}
else {
double angle = atan2(P[j].second - P[i].second, P[j].first - P[i].first);
double a = P[i].first, b = P[i].second;
double x = dist(P[i], P[j]) / 2, y = dist(P[i], P[j]) * sqrt(3) / 2;
res += find(a, b, x, y, angle);
res += find(a, b, x, -y, angle);
}
}
ofstream(oname) << res / 3;
return 0;
}