#include <bits/stdc++.h>

#define ll long long

using namespace std;

int main() {

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

    int n;
    cin >> n;

    ll x[n], y[n];
    for(int i = 0; i < n; i++)
        cin >> x[i] >> y[i];
    
    map<pair<ll, ll>, ll> cnt;
    for(int i = 0; i < n - 1; i++) {
        for(int j = i + 1; j < n; j++) {
            ll tx = x[i] - x[j], ty = y[i] - y[j];
            if(tx < 0) {
                tx = -tx;
                ty = -ty;
            } else if(tx == 0) {
                if(ty < 0)
                    ty = -ty;
            }

            cnt[{tx, ty}]++;
        }
    }
    
    ll ans = 0;
    for(int i = 0; i < n - 1; i++) {
        for(int j = i + 1; j < n; j++) {
            ll tx = x[i] - x[j], ty = y[i] - y[j];
            if(tx < 0) {
                tx = -tx;
                ty = -ty;
            } else if(tx == 0) {
                if(ty < 0)
                    ty = -ty;
            }
            
            ans += cnt[{2 * tx, 2 * ty}];
        }
    }
    cout << ans << endl;
    return 0;
}