#include<bits/stdc++.h>
#define MOD 1000000007LL
#define ll long long

using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin>>n;
    pair<ll,ll> points[1515];
    for(int i=0;i<n;i++){
        cin>>points[i].first>>points[i].second;
    }
    vector<pair<ll,ll> > vectdis;
    for(int i=0;i<n-1;i++){
        for(int j=i+1;j<n;j++){
            ll xdis=points[i].first-points[j].first;
            ll ydis=points[i].second-points[j].second;
            if(xdis<0){
                xdis=-xdis;
                ydis=-ydis;
            }
            if(xdis==0){
                ydis=abs(ydis);
            }
            if(ydis==0){
                xdis=abs(xdis);
            }
            vectdis.push_back(make_pair(xdis,ydis));
            vectdis.push_back(make_pair(2*xdis,2*ydis));
        }
    }
    sort(vectdis.begin(),vectdis.end());
    int streak=1;
    int cur=0;
    int ans=0;
    for(int i=1;i<vectdis.size();i++){
        if(vectdis[cur].first==vectdis[i].first && vectdis[cur].second==vectdis[i].second){
            streak+=1;
        }
        else{
            ans+=streak*(streak-1)/2;
            cur=i;
            streak=1;
        }
    }
    cout<<ans+streak*(streak-1)/2;
    return 0;
}