#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;
bool cmp(slog a, slog b){
	if(a.D <b.D)return true;
	if(a.D==b.D and a.dx <b.dx)return true;
	if(a.D==b.D and a.dx==b.dx and a.dy<b.dy)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];
			l.D=dx*dx+dy*dy;
			if(dx!=0 and dy!=0){
				nzd=NZD(dx,dy);
				l.dx=dx/nzd;
				l.dy=dy/nzd;
			}
			if(dx==0){
				l.dx=0;
				l.dy=1;
			}
			if(dy==0){
				l.dx=1;
				l.dy=0;
			}
			if(l.dy<0){
				l.dy=-l.dy;
				l.dx=-l.dx;
			}
			niz[++n]=l;
		}
	}
	//cout<<endl;
	sort(niz+1,niz+1+n,cmp);
	pok=1;
	niz[1].kol=1;
	for(int i=2; i<=n; i++){
		if(niz[pok].D!=niz[i].D or niz[pok].dx!=niz[i].dx or niz[pok].dy!=niz[i].dy){
			niz[++pok]=niz[i];
			niz[pok].kol=0;
		}
		niz[pok].kol++;
	}
	n=pok;
	pok=1;
	for(int i=1; i<=n; i++){
		l=niz[i];
		while(l.D*4>niz[pok].D)pok++;
		while(l.D*4==niz[pok+1].D and l.dx>niz[pok].dx)pok++;
		while(l.D*4==niz[pok+1].D and l.dx==niz[pok+1].dx and l.dy>niz[pok].dy)pok++;
		if(l.D*4==niz[pok].D and l.dx==niz[pok].dx and l.dy==niz[pok].dy)
			sol+=l.kol*niz[pok].kol;
	}
	cout<<sol<<endl;
	return 0;
}