#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mk make_pair
#define v_sort(x) sort(x.begin(),x.end())
#define v_gsort(x) sort(x.begin(),x.end(),greater<ll>())
#define v_find(x,num) find(x.begin(),x.end(),num)
#define PI 3.14159265
#define MOD 1000000007
#define MOD1 998244353

using namespace std;

void Solve(){
  int n;
  cin>>n;
  vector<pair<ll,ll>>a(n);
  map<double,unordered_map<ll,ll>>mp;
  map<ll,ll>y;
  for(int i=0;i<n;i++) cin>>a[i].first>>a[i].second;
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      if((a[i].first-a[j].first)==0) {
        y[abs(a[i].second-a[j].second)]++;
      }
      else {
        double k=(double)(a[i].second-a[j].second)/(double)(a[i].first-a[j].first);
        ll val = (a[i].second-a[j].second) *  (a[i].second-a[j].second) + (a[i].first-a[j].first) * (a[i].first-a[j].first);
        mp[k][val]++;
      }
    }
  }
  ll ans=0;
  for(auto k:mp){
    for(auto c:k.second){
      ans+=k.second[c.first]*k.second[c.first*4];
    }
  }
  for(auto k:y) ans+=k.second*y[k.first*2];
  cout<<ans<<'\n';
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int t=1;
//  freopen("input.txt","r",stdin);
//  freopen("output.txt","w",stdout);
//  cin>>t;
  while(t--){
    Solve();
  }
  return 0;
}