#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define sp ' '
#define en '\n'
using namespace std;
const int N = 2e5 + 5;
const ll mod = 1e9 + 7;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    vector<ll> x(n), y(n);
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i];
    }
    vector<int> order(n);
    iota(order.begin(), order.end(), 0);
    sort(order.begin(), order.end(), [&] (int i, int j) {
        if (x[i] != x[j]) return x[i] < x[j];
        return y[i] < y[j];
    });
    map<pair<ll, ll>, ll> m;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            ll dx = x[order[j]] - x[order[i]];
            ll dy = y[order[j]] - y[order[i]];
            m[{dx, dy}] += 1;
        }
    }
    ll ans = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            ll dx = x[order[j]] - x[order[i]];
            ll dy = y[order[j]] - y[order[i]];
            ans += m[{2 * dx, 2 * dy}];
            ans += m[{-2 * dx, -2 * dy}];
        }
    }
    cout << ans << en;
    return 0;

}