#include <bits/stdc++.h>

#define xx first
#define yy second
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define mp make_pair
#define pb push_back
#define popb pop_back

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef string str;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int MAX=3e6;
ll n, br, res;
ll x[MAX], y[MAX], dist[MAX];
map<ll, vector<pll>> m;


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    cin >> n;
    for(ll i=0;i<n;++i) cin >> x[i] >> y[i];
    for(ll i=0;i<n;++i){
        for(ll j=i+1;j<n;++j){
            ll d=(x[j]-x[i])*(x[j]-x[i])+(y[j]-y[i])*(y[j]-y[i]);
            m[d].pb({y[j]-y[i], x[j]-x[i]});
            dist[br++]=d;
        }
    }
    sort(dist, dist+n*(n-1)/2);
    for(auto it=m.begin();it!=m.end();it++){
        ll v=(it->xx);
        vector<pll> kol=(it->yy);
        v*=4;
        for(ll i=0;i<m[v].size();++i){
            ll b2=m[v][i].xx;
            ll i2=m[v][i].yy;
            for(ll j=0;j<kol.size();++j){
                ll b1=kol[i].xx;
                ll i1=kol[i].yy;
                if(b2==0 && i1==0) continue;
                if(b1==0 && i2==0) continue;
                if(b1*i2==b2*i1) ++res;
            }
        }
    }
    cout << res/2 << '\n';

    return 0;
}