#include <bits/stdc++.h>
#define MAXN 1510
#define X first
#define Y second
#define L first
#define KX second.first
#define KY second.second

using namespace std;

typedef long long ll;

array<pair<ll, ll>, MAXN> tacke;
vector<pair<ll, pair<ll, ll>>> duzi;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    ll n, dx, dy, l, nzd, ddx, ddy, rez = 0;
    cin >> n;
    for(int i = 1; i <= n; i++)
    {
        cin >> tacke[i].X >> tacke[i].Y;
    }
    for(int i = 1; i <= n; i++)
    {
        for(int j = i + 1; j <= n; j++)
        {
            dx = tacke[i].X - tacke[j].X;
            dy = tacke[i].Y - tacke[j].Y;
            l = dx * dx + dy * dy;
            nzd = abs(__gcd(dx, dy));
            ddx = dx / nzd;
            ddy = dy / nzd;
            if(ddx * ddy >= 0)
            {
                ddx = abs(ddx);
                ddy = abs(ddy);
            }
            else
            {
                ddx = -abs(ddx);
                ddy = abs(ddy);
            }
            duzi.push_back({l, {ddx, ddy}});
        }
    }
    /**
    for(auto x : duzi)
    {
        cout << x.L << " " << x.KX << " " << x.KY << "\n";
    }
    **/
    sort(duzi.begin(), duzi.end());
    pair<ll, pair<ll, ll>> z;
    for(auto x : duzi)
    {
        z = {x.L * 4, {x.KX, x.KY}};
        auto y = equal_range(duzi.begin(), duzi.end(), z);
        rez += y.second - y.first;
    }
    cout << rez;
    return 0;
}