#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1505;

ll n,x[N],y[N];
ll dist[N][N];
int gr[N][N],dl[N][N];
vector <ll> v[2];

bool cmp(pair <ll,ll> a,pair <ll,ll> b){
    ll p = gr[a.first][a.second]*dl[b.first][b.second];
    ll q = gr[b.first][b.second]*dl[a.first][a.second];
    return p < q;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> x[i] >> y[i];
    }

    vector <pair<ll,ll>> u;
    for(int i = 1; i <= n; i++){
        for(int j = i+1; j <= n; j++){
            dist[i][j] = dist[j][i] = (x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);

            ll gore = y[j]-y[i],dole = x[j]-x[i];

            if(dole == 0){ /// k = besk
                v[0].push_back(dist[i][j]);
                continue;
            }
            if(gore == 0){
                v[1].push_back(dist[i][j]);
                continue;
            }

            ll g = __gcd(gore,dole);
            gore /= g;
            dole /= g;

            if(gore < 0 && dole < 0){
                gore = -gore;
                dole = -dole;
            }
            else if(dole < 0){
                gore = -gore;
                dole = -dole;
            }

            u.push_back({i,j});
            gr[i][j] = gr[j][i] = gore;
            dl[i][j] = dl[j][i] = dole;
        }
    }

    sort(u.begin(),u.end(),cmp);

    ll sol = 0;
    map <ll,int> mapa;
    for(int i = 0; i < u.size(); ){
        int j = i;
        while(j < u.size()-1 && gr[u[j].first][u[j].second] == gr[u[j+1].first][u[j+1].second] && dl[u[j].first][u[j].second] == dl[u[j+1].first][u[j+1].second]){
            j++;
        }

        mapa.clear();
        for(int h = i; h <= j; h++) mapa[dist[u[h].first][u[h].second]]++;
        for(int h = i; h <= j; h++) sol += mapa[4*dist[u[h].first][u[h].second]];

        i = j+1;
    }

    mapa.clear();
    for(auto f : v[0]) mapa[f]++;
    for(auto f : v[0]) sol += mapa[4*f];

    mapa.clear();
    for(auto f : v[1]) mapa[f]++;
    for(auto f : v[1]) sol += mapa[4*f];

    cout << sol << endl;
}