#include <bits/stdc++.h>
#define ll long long
#define MAXN 1510
using namespace std;
struct pair_hash
{
    template <class T1,class T2>
    size_t operator() (const pair<T1,T2> &pair) const
    {
        return hash<T1>()(pair.first)^hash<T2>()(pair.second);
    }
};
unordered_map<pair<double,double>,ll,pair_hash> m;
unordered_map<double,ll> mpy;
vector<pair<double,double> > v,r,b;
vector<double> py,a;
double x[MAXN],y[MAXN];
bool Cmp(pair<ll,ll> p,pair<ll,ll> q)
{
    if (p.first!=q.first)
        return (p.first<q.first);
    return (p.second<q.second);
}
bool Check(double d)
{
    ll l=0,r=a.size()-1,mid;
    while (l<=r)
    {
        mid=(l+r)/2;
        if (a[mid]==d)
            return true;
        if (a[mid]>d)
            r=mid-1;
        else
            l=mid+1;
    }
    return false;
}
bool Check1(double d,ll l,ll r)
{
    ll mid;
    while (l<=r)
    {
        mid=(l+r)/2;
        if (b[mid].second==d)
            return true;
        if (b[mid].second>d)
            r=mid-1;
        else
            l=mid+1;
    }
    return false;
}
int main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    ll n,cnt=0;
    cin >> n;
    for (ll i=1;i<=n;i++)
    {
        cin >> x[i] >> y[i];
        v.push_back({x[i],y[i]});
    }
    sort(v.begin(),v.end());
    for (ll i=0;i<n;i++)
    {
        for (ll j=i+1;j<n;j++)
        {
            if (v[i].first==v[j].first)
            {
                py.push_back(abs(v[i].second-v[j].second));
                mpy[abs(v[i].second-v[j].second)]++;
                continue;
            }
            double x1=v[i].first,y1=v[i].second,x2=v[j].first,y2=v[j].second;
            r.push_back({(double)((y2-y1)/(x2-x1)),(double)(sqrt((y2-y1)*(y2-y1)+(x2-x1)*(x2-x1)))});
            m[{(double)(sqrt((y2-y1)*(y2-y1)+(x2-x1)*(x2-x1))),(double)((y2-y1)/(x2-x1))}]++;
        }
    }
    sort(py.begin(),py.end());
    a=py;
    for (ll i=0;i<a.size();i++)
    {
        cnt+=mpy[2*a[i]];
    }
    for (ll i=0;i<r.size();i++)
    {
        cnt+=m[{2*r[i].second,r[i].first}];
    }
    cout << cnt << "\n";
    return 0;
}