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

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int N;
    cin >> N;
    pair<ll, ll> tacke[N];
    for (int i = 0; i < N; ++i){
        ll x, y;
        cin >> x >> y;
        tacke[i] = {x, y};
    }
    vector<pair<ll, ll>> segments;
    pair<int, int> memorize[(N-1)*N/2];
    int cnt = 0;
    for (int i = 0; i < N-1; ++i){
        for (int j = i+1; j < N; ++j){
            segments.push_back({((tacke[j].second-tacke[i].second)*(tacke[j].second-tacke[i].second) + (tacke[j].first-tacke[i].first)*(tacke[j].first-tacke[i].first)), cnt});
            memorize[cnt++] = {i, j};
        }
    }
    sort(segments.begin(), segments.end());
    ll brojac = 0;
    for (int i = 0; i < N*(N-1)/2; ++i){
        pair<ll, ll> example = {4*segments[i].first, 0};
        int a = lower_bound(segments.begin(), segments.end(), example) - segments.begin();
        for (int j = a; j < (N*(N-1)/2) && (segments[j].first == (4*segments[i].first)); ++j){
            ll x1 = tacke[memorize[segments[i].second].first].first, x2 = tacke[memorize[segments[i].second].second].first, y1 = tacke[memorize[segments[i].second].first].second, y2 = tacke[memorize[segments[i].second].second].second;
            ll x3 = tacke[memorize[segments[j].second].first].first, x4 = tacke[memorize[segments[j].second].second].first, y3 = tacke[memorize[segments[j].second].first].second, y4 = tacke[memorize[segments[j].second].second].second;
            if ((y1-y2)*(x3-x4) == (y3-y4)*(x1-x2))
                brojac++;
        }
    }
    cout << brojac;
    return 0;
}