#include <bits/stdc++.h>

#define ll long long
#define pb push_back

using namespace std;

vector< pair<ll, ll> > v;

int lb(pair<ll, ll> x) {

    int l = 0, r = v.size() - 1;
    while(l <= r) {
        int mid = (l + r) / 2;
        if(v[mid] >= x)
            r = mid - 1;
        else
            l = mid + 1;
    }
    return r + 1;
}

int ub(pair<ll, ll> x) {

    int l = 0, r = v.size() - 1;
    while(l <= r) {
        int mid = (l + r) / 2;
        if(v[mid] > x)
            r = mid - 1;
        else
            l = mid + 1;
    }
    return r + 1;
}

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];
    
    
    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;
            }

            v.pb({tx, ty});
        }
    }
    sort(v.begin(), v.end());
    
    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 += ub({2 * tx, 2 * ty}) - lb({2 * tx, 2 * ty});
        }
    }
    cout << ans << endl;
    return 0;
}