#include <bits/stdc++.h>;

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    map<pair<double, long long>, int> cnt; //map<pair<nagib, duzina>, brojac>

    int N; cin >> N;
    int x[N];
    int y[N];
    for(int i = 0; i < N; i++)
    {
        cin >> x[i] >> y[i];
    }

    for(int i = 0; i < N-1; i++)
    {
        for(int j = i+1; j < N; j++)
        {
            int deltaX = abs(x[i] - x[j]);
            int deltaY = abs(y[i] - y[j]);
            //cout << '\n' << "Nagib " << i << " prema " << j << " " << (double)deltaY/deltaX;
            cnt[{(double)deltaY/deltaX, (long long)deltaX*deltaX + (long long)deltaY*deltaY}]++;
        }
    }

    int broj = 0;
    for(auto x : cnt)
    {
        double nagib = x.first.first;
        long long duzina = x.first.second;
        broj += (cnt[{nagib, duzina}] * cnt[{nagib, duzina * 4}]);
        //cout << "\n" << "Nagib: " << nagib << "\tDuzina: " << duzina << "\tCount: " << cnt[x.first];
    }
    cout << broj;
    return 0;
}