#include <bits/stdc++.h>

using namespace std;

const int N = 1510;
const int INF = 1e9;

pair<long long, long long> a[N];
map<tuple<long long, long long, long long>, long long> mp;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i].first >> a[i].second;
    }
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            long long x = a[j].first - a[i].first;
            long long y = a[j].second - a[i].second;
            long long dist = x * x + y * y;
            if (y < 0) {
                x *= -1;
                y *= -1;
            }
            if (y == 0) {
                mp[make_tuple(INF, 0, dist)]++;
            } else if (x == 0) {
                mp[make_tuple(0, INF, dist)]++;
            } else {
                long long nzd = __gcd(x, y);
                x /= nzd;
                y /= nzd;
                mp[make_tuple(x, y, dist)]++;
            }
        }
    }
    long long ans = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            long long x = a[j].first - a[i].first;
            long long y = a[j].second - a[i].second;
            long long dist = x * x + y * y;
            if (y < 0) {
                x *= -1;
                y *= -1;
            }
            if (y == 0) {
                ans += mp[make_tuple(INF, 0, dist * 4)];
            } else if (x == 0) {
                ans += mp[make_tuple(0, INF, dist * 4)];
            } else {
                long long nzd = __gcd(x, y);
                x /= nzd;
                y /= nzd;
                ans += mp[make_tuple(x, y, dist * 4)];
            }
        }
    }
    cout << ans;

    return 0;
}