#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];
    }
    map<pair<ll, ll>, ll> m;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            ll dx = x[j] - x[i];
            ll dy = y[j] - y[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[j] - x[i];
            ll dy = y[j] - y[i];
            ans += m[{2 * dx, 2 * dy}];
            ans += m[{-2 * dx, -2 * dy}];
        }
    }
    cout << ans << en;
    return 0;

}