#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll N,del,p1,p2,kraj,res=0;
struct tacka{
   ll x,y;
}niz[1505];
struct prava{
   ll razx,razy;
   bool operator < (const prava &k) const {
      if(razy<k.razy)
         return true;
      if(razy>k.razy)
         return false;
      return razx<k.razx;
   };
}pp;
ll nzd(ll a,ll b){
   if(b==0)
      return a;
   return nzd(b,a%b);
}
ll udaljenost(tacka a,tacka b){
   return (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);
}
prava linija(tacka a,tacka b){
   if(a.x>b.x)
      swap(a,b);
   pp.razx=a.x-b.x;
   pp.razy=a.y-b.y;
   del=nzd(pp.razx,pp.razy);
   pp.razx/=del;
   pp.razy/=del;
   if(pp.razx==0)
      pp.razy=1;
   if(pp.razy==0)
      pp.razx=1;
   if((pp.razy<0 and pp.razx>0) or (pp.razy<0 and pp.razx<0)){
      pp.razy=-pp.razy;
      pp.razx=-pp.razx;
   }
   return pp;
}
clock_t a;
map<prava,vector<ll>> mapa;
int main(){
   ios_base::sync_with_stdio(false);
   cin.tie(0);
   cout.tie(0);
   a=clock();
   cin>>N;
   for(int i=1;i<=N;i++){
      cin>>niz[i].x>>niz[i].y;
      niz[i].x+=1e8;
      niz[i].y+=1e8;
   }
   for(int i=1;i<=N;i++)
      for(int j=i+1;j<=N;j++)
         mapa[linija(niz[i],niz[j])].push_back(udaljenost(niz[i],niz[j]));
   for(map<prava,vector<ll>>::iterator it=mapa.begin();it!=mapa.end();it++){
      sort(it->second.begin(),it->second.end());
      it->second.push_back(1ll<<63-1);
      p1=0;
      for(int i=0;i<it->second.size();i++){
         kraj=i+1;
         while(kraj<it->second.size()){
            if(it->second[kraj]!=it->second[kraj-1])
               break;
            kraj++;
         }
         kraj--;
         while(it->second[p1]<it->second[i]/4)
            p1++;
         if(it->second[p1]!=it->second[i]/4){
            i=kraj;
            continue;
         }
         p2=p1;
         while(it->second[p2]==it->second[p1])
            p2++;
         p2--;
         res+=(kraj-i+1)*(p2-p1+1);
         i=kraj;
      }
   }
   cout<<res<<endl;
   return 0;
}