#include<bits/stdc++.h>
using namespace std;
int N,x[1509],y[1509],nzd,n,pok;
long long dx,dy,sol;
struct slog{
	long long D,dy,dx;
	int kol;
}niz[2300009],l,a,b;
bool cmp(slog a, slog b){
	if(a.dx <b.dx)return true;
	if(a.dx==b.dx and a.dy <b.dy)return true;
	if(a.dx==b.dx and a.dy==b.dy and a.D<b.D)return true;
	return false;
}
int NZD(int a,int b){
	a=abs(a);
	b=abs(b);
	while(a%b){
		swap(a,b);
		a%=b;
	}
	return b;
}
int main(){

	cin>>N;
	for(int i=1; i<=N; i++)cin>>x[i]>>y[i];

	N=1500;
	for(int i=1; i<=N; i++){
		x[i]=rand();
		y[i]=rand();
		for(int j=1; j<i; j++)
			if(x[i]==x[j] and y[i]==y[j]){i--; break;}
	}
	cout<<"ok"<<endl;

	for(int i=1; i<=N; i++)
		for(int j=i+1; j<=N; j++){
			dx=x[i]-x[j];
			dy=y[i]-y[j];
			a.D=dx*dx+dy*dy;
			if(dx!=0 and dy!=0){
				nzd=NZD(dx,dy);
				a.dx=dx/nzd;
				a.dy=dy/nzd;
			}
			if(dx==0){ a.dx=0; a.dy=1; }
			if(dy==0){ a.dx=1; a.dy=0; }
			if(a.dy<0){ a.dy=-a.dy; a.dx=-a.dx; }
			niz[++n]=a;
		}
	sort(niz+1,niz+1+n,cmp);
	pok=0;
	a=niz[0];
	for(int i=1; i<=n; i++){
    b=niz[i];
    if(a.dx!=b.dx or a.dy!=b.dy or a.D!=b.D)niz[++pok]=b;
    niz[pok].kol++;
	}
	n=pok;
	pok=1;
	for(int i=1; i<=n; i++){
    a=niz[i];
    b=niz[pok];
    while(a.dx==b.dx and a.dy==b.dy and a.D*4>b.D)b=niz[++pok];
    if(a.dx==b.dx and a.dy==b.dy and a.D*4==b.D)sol+=(long long)a.kol*b.kol;
	}
	cout<<sol<<endl;
	return 0;
}