#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;
ll Dist(ll x1, ll y1, ll x2, ll y2) {
    ll x = x1 - x2;
    ll y = y1 - y2;
    return x * x + y * y;
}
ll Gcd(ll a, ll b) {
    if (b == 0) return a;
    return Gcd(b, a % b);
}
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<pair<ll, ll>, ll>, ll> m;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            ll d = Dist(x[i], y[i], x[j], y[j]);
            if (x[i] == x[j]) {
                m[{{1e9,1e9},d}] += 1;
                continue;
            }
            if (y[i] == y[j]) {
                m[{{0,0},d}] += 1;
                continue;
            }
            ll Dx = x[j] - x[i];
            ll Dy = y[j] - y[i];
            if (Dy < 0) {
                Dx *= -1;
                Dy *= -1;
            }
            ll k = Gcd(abs(Dx), Dy);
            Dx /= k;
            Dy /= k;
            m[{{Dx, Dy}, d}] += 1;
        }
    }
    ll ans = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            ll d = Dist(x[i], y[i], x[j], y[j]);
            if (x[i] == x[j]) {
                ans += m[{{1e9,1e9},4 * d}];
                continue;
            }
            if (y[i] == y[j]) {
                ans += m[{{0,0},4 * d}];
                continue;
            }
            ll Dx = x[j] - x[i];
            ll Dy = y[j] - y[i];
            if (Dy < 0) {
                Dx *= -1;
                Dy *= -1;
            }
            ll k = Gcd(abs(Dx), Dy);
            Dx /= k;
            Dy /= k;
            ans += m[{{Dx, Dy}, 4 * d}];
        }
    }
    cout << ans << en;
    return 0;

}