#include<bits/stdc++.h>

using namespace std;

int n;
long long R=0;
struct xy
{
    double x,y;
};
xy tacke[1505];

struct duz
{
    double k;
    long long duzina;
    bool operator<( duz b) const
    {
        if(k == b.k)
            return duzina < b.duzina;
        else
            return k < b.k;
    };
};



map<duz, long long> mapa;
map<duz, long long> mapa2;

int main()
{
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>tacke[i].x>>tacke[i].y;
    }

    //cout<<endl;
    for(int i=1;i<n;i++)
    {
        for(int j=i+1;j<=n;j++)
        {
            duz pr;
            if(tacke[i].x==tacke[j].x)
                pr.k=2000000000;  /// 2e9
            else
                pr.k=(tacke[i].y-tacke[j].y)/(tacke[i].x-tacke[j].x);
            pr.duzina=((long long)tacke[i].y-tacke[j].y)*(tacke[i].y-tacke[j].y)+((long long)tacke[i].x-tacke[j].x)*(tacke[i].x-tacke[j].x);  /// NIJE KORENOVANO

            //cout<<pr.k<<" "<<pr.duzina<<endl;

            mapa[pr]++;
            mapa2[pr]++;
        }
    }
    //cout<<endl;
    for(auto it=mapa.begin(); it!=mapa.end(); ++it)
    {
        duz d = it->first;
        long long koliko = it->second;

        duz par = d;
        par.duzina *= 4;

        R+=koliko * mapa2[par];
    }
    cout<<R<<endl;

    return 0;
}