#include <bits/stdc++.h>
#define ll long long

using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cerr.tie(0);
    int N;
    cin >> N;
    vector <int> x (N);
    vector <int> y (N);
    for (int i = 0; i < N; i++)
        cin >> x[i] >> y[i];
    int M = (N * (N - 1)) / 2;
    vector <int> xd (M,0);
    vector <int> yd (M,0);
    int k = 0;
    for (int i = 0; i < N; i++)
    {
        for (int j = i + 1; j < N; j++)
        {
            xd[k] = abs(max(x[i],x[j]) - min(x[i],x[j]));
            if (x[i] <= x[j])
                yd[k] = y[j] - y[i];
            else
                yd[k] = y[i] - y[j];
            k++;
        }
    }
    map<pair<int,int>,int> a;
    for (int i = 0; i < M; i++)
    {
        pair<int,int> cnt;
        cnt.first = xd[i];
        cnt.second = yd[i];
        a[cnt]++;
    }
    ll ans = 0;
    for (int i = 0; i < M; i++)
    {
        pair<int,int> cnt1;
        cnt1.first = 2 * xd[i];
        cnt1.second = 2 * yd[i];
        ans += a[cnt1];
        pair<int,int> cnt2;
        cnt2.first = (-2) * xd[i];
        cnt2.second = (-2) * yd[i];
        ans += a[cnt2];
    }
    cout << ans;
    return 0;
}