#include <iostream>
#include <fstream>
#include <cmath>
#include <algorithm>
#include <vector>
#define pb push_back
#define mp make_pair
#define MAXN 1501
#define INFILE "triang.in"
#define OUTFILE "triang.out"
#define eps 0.001
#define x first
#define y second
using namespace std;
ifstream f(INFILE);
ofstream g(OUTFILE);
int n,k,i,j,l;
//70 puncte - O(N^3)
/*double v[MAXN][2],aux;
inline double dist(double x1, double y1, double x2, double y2)
{
return ((x1-x2)*(x1-x2)+(y2-y1)*(y2-y1));
}
int main()
{
f>>n;
for(i=1;i<=n;i++)
f>>v[i][0]>>v[i][1];
for(i=1;i<n-1;i++)
for(j=i+1;j<n;j++)
{
aux=dist(v[i][0],v[i][1],v[j][0],v[j][1]);
for(l=j+1;l<=n;l++)
if(abs(aux-dist(v[i][0],v[i][1],v[l][0],v[l][1]))<eps&&abs(aux-dist(v[j][0],v[j][1],v[l][0],v[l][1]))<eps)k++;
}
g<<k;
f.close();
g.close();
return 0;
}*/
//Pe exemplu da corect, pe infoarena 9 gresite si 1 TLE, nu stiu care ar putea fi problema
vector<pair<double,double> >v;
vector<pair<double,double> >::iterator it,jt,aux;
double x,y,A,sina,cosa,d,sqrt3,xres,yres;
inline bool comp(const pair<double,double>& a,const pair<double,double>& b)
{
if(fabs(a.x-b.x)<eps)return a.y<b.y;
return a.x<b.x;
}
double fabs (double a) {
if (a<0)
return -a;
return a;
}
int main()
{
const double sin60 = sin(60*M_PI/180);
const double cos60 = cos(60*M_PI/180);
f>>n;
sqrt3=sqrt((double)3);
for(i=1;i<=n;i++)
{
f>>x>>y;
v.pb(mp(x,y));
}
sort(v.begin(),v.end(),comp);
for(it=v.begin();it!=v.end();it++)
for(jt=it+1;jt!=v.end();jt++)
{
xres=it->x+(jt->x-it->x)*cos60-(jt->y-it->y)*sin60;
yres=it->y+(jt->x-it->x)*sin60+(jt->y-it->y)*cos60;
aux=upper_bound(v.begin(),v.end(),mp(xres,yres),comp);
if(aux!=v.begin())
{
aux--;
if(fabs(aux->x-xres)<eps&&fabs(aux->y-yres)<eps)k++;
}
xres=jt->x+(it->x-jt->x)*cos60-(it->y-jt->y)*sin60;
yres=jt->y+(it->x-jt->x)*sin60+(it->y-jt->y)*cos60;
aux=upper_bound(v.begin(),v.end(),mp(xres,yres),comp);
if(aux!=v.begin())
{
aux--;
if(fabs(aux->x-xres)<eps&&fabs(aux->y-yres)<eps)k++;
}
}
g<<k/3;
f.close();
g.close();
return 0;
}