#include <bits/stdc++.h>
using namespace std;

pair<int,int> d(int a, int b, int c, int d) {
    int dx = a - c, dy = b - d;
    dy = (dx > 0 ? dy : (dx == 0 ? abs(dy) : -dy));
    return {abs(dx), dy};
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int n; cin >> n;
    vector<int> x(n), y(n);
    map<pair<int,int>,int> c;
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i];
        for (int j = 0; j < i; j++) {
            c[d(x[i], y[i], x[j], y[j])]++;
        }
    }
    long long r = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < i; j++) {
            pair<int,int> z;
            z = d(x[i], y[i], x[j], y[j]);
            r += c[{2 * z.first, 2 * z.second}];
        }
    }
    cout << r << endl;
}