#include <bits/stdc++.h>
# define endl            '\n'
# define clr(x,a)        memset(x,a,sizeof(x))
# define vi              vector<int>
# define all(a)          a.begin(), a.end()
# define deb(x)          cout<<#x<<"=="<<x<<endl;
# define pb              push_back
# define sc              scanf
# define pr              printf
# define tc              int testcase; cin>>testcase; while(testcase--)
# define rev(s)          reverse(s.begin(),s.end())
# define linija          cout<<"___________\n";
using namespace std;
typedef long long ll;
const int mxN=1503;
const float maxk=537905323.0;
int n, sol;
struct Point{
   ll x, y;
}tacke[mxN];
struct Slog{
   ll dist, k;
}niz[2259009], pom;
int br;
//bool jednaki(Slog a, Slog b){
//   return (a.kd*b.kg==a.kg*b.kd);
//}
map <ll, int> mapa;
ll dist(Point a, Point b){
   return (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);
}
bool cmp(Slog a, Slog b){
   return (a.k<b.k); // -> (a.kg/a.kd < b.kg/b.kd)
}
int main(){
   cin>>n;
   for(int i=1; i<=n; i++){
      sc("%lld%lld", &tacke[i].x, &tacke[i].y);
   }
   for(int i=1; i<n; i++){
      for(int j=i+1; j<=n; j++){
         br++;
         niz[br].dist=dist(tacke[i], tacke[j]);
         if(tacke[i].x==tacke[j].x){
            niz[br].k=maxk;
         }
         else{
            niz[br].k=(tacke[i].y-tacke[j].y)/(1.0*(tacke[i].x-tacke[j].x));
         }
      }
   }

   sort(niz+1, niz+1+br, cmp);
//   for(int i=1; i<=br; i++){
//      cout<<niz[i].dist<<", "<<niz[i].k<<endl;
//   }
//   cout<<endl;
   ll t;
   for(int i=1; i<=br; i++){
      mapa.clear();
      mapa[niz[i].dist]=1;
      while(niz[i].k==niz[i+1].k && i<br){
         i++;
         t=niz[i].dist;
         if(t%4==0){
            if(mapa.find(t/4)!=mapa.end()) sol+=mapa[t/4];
         }
         if(mapa.find(t*4)!=mapa.end()) sol+=mapa[t*4];
         mapa[t]++;
      }
   }
   cout<<sol<<endl;

   return 0;
}