#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;
   }
//   cout<<a.x<<" "<<a.y<<"  "<<b.x<<" "<<b.y<<endl;
  // cout<<pp.razx<<" "<<pp.razy<<endl;
   return pp;
}
map<prava,vector<ll>> mapa;
vector<ll> vek;
int main(){
   //freopen("Input3.txt","r",stdin);
   ios_base::sync_with_stdio(false);
   cin.tie(0);
   cout.tie(0);
   cin>>N;
   for(int i=1;i<=N;i++){
      cin>>niz[i].x>>niz[i].y;
      //niz[i].x+=1e8;
      //niz[i].y+=1e8;
   }
   //cout<<"DEBUG"<<endl;
   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]));
  // cout<<"GRUPE"<<endl;
   for(map<prava,vector<ll>>::iterator it=mapa.begin();it!=mapa.end();it++){
   //   cout<<res<<endl;
      vek=it->second;
      sort(vek.begin(),vek.end());
      vek.push_back(1ll<<63-1);
     // cout<<it->first.razx<<" "<<it->first.razy<<endl;
     // cout<<vek.size()-1<<endl;
      /*cout<<"Grupa: ";
      for(int i=0;i<vek.size()-1;i++)
         cout<<vek[i]<<" ";
      cout<<endl;*/
      p1=0;
      for(int i=0;i<vek.size();i++){
         kraj=i+1;
         while(kraj<vek.size()){
            if(vek[kraj]!=vek[kraj-1])
               break;
            kraj++;
         }
         kraj--;
         while(vek[p1]<vek[i]/4)
            p1++;
         if(vek[p1]!=vek[i]/4){
            i=kraj;
            continue;
         }
         p2=p1;
         while(vek[p2]==vek[p1])
            p2++;
         p2--;
         //cout<<p1<<" "<<p2<<" "<<i<<" "<<kraj<<endl;
         res+=(kraj-i+1)*(p2-p1+1);
         i=kraj;
      }
   }
   cout<<res<<endl;
   return 0;
}
/*
10
1 6
7 7
5 6
8 8
4 9
5 2
0 9
1 7
7 2
6 5
*/
/*
30
27 22
39 3
21 18
42 41
23 32
20 22
34 0
13 17
8 14
16 15
14 30
45 48
32 8
36 39
40 37
46 42
6 0
21 49
19 36
19 12
30 40
31 1
10 3
25 40
25 14
38 8
43 25
43 21
35 30
49 32
*/