#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,kol;
}niz[2300009],a,b;
bool cmp(slog a, slog b){
	if(a.dx <b.dx)return true;///1. da idu manji dx-evi
	if(a.dx==b.dx and a.dy <b.dy)return true;///2. da idu manji dy-evi
	if(a.dx==b.dx and a.dy==b.dy and a.D<b.D)return true;///3. da idu manji D-ovi
	return false;
}
int NZD(int a,int b){
	a=abs(a);
	b=abs(b);
	if(a==0)return b;
	if(b==0)return a;
	while(a%b){
		swap(a,b);
		a%=b;
	}
	return b;
}
int main(){
  ///=>unos<=///
	cin>>N;
	for(int i=1; i<=N; i++)cin>>x[i]>>y[i];
	///=>obrada<=///
	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;///kvadrat rastojanja
			nzd=NZD(dx,dy);///nzd dx,dy
      a.dx=dx/nzd;///uzajamno prosti dx => 2 prave || akko {   ( dx1==dx2 i  dy1==*dy2)
      a.dy=dy/nzd;///uzajamno prosti dy =>                  ili(-dx1==dx2 i -dy1==*dy2 }
			if(a.dy<0){ a.dy=-a.dy; a.dx=-a.dx; }/// obrni znak tako da je dy>0
			niz[++n]=a;///dodaj u niz
		}
	sort(niz+1,niz+1+n,cmp);///sortiraj tako da tacke koje imaju isti dx/dy budu susedne
	///=>grupisi ono sto se ponavlja<=///
	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;
	///=>izracunaj sol<=///
	pok=1;
	niz[n+1].D=0;
	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+=a.kol*b.kol;
	}
	cout<<sol<<endl;
	return 0;
}