#include<bits/stdc++.h>
using namespace std;

#define endl '\n'
#define ll long long
#define NMAX (int)1e6
#define vi vector<int>
#define pii pair<int,int>
#define w(x) cout<<#x<<':'<<x<<endl;
#define PB push_back
#define juseinbolt ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

/*vector<int> prosti;
void sieve(int maks)
{
    vector<bool> prost(maks+5,1);
    for(int i=2; i<=maks; ++i)
    {
        if(!prost[i]) continue;
        prosti.PB(i);
        for(int j=2*i; j<=maks; j+=i) prost[j]=false;
    }
}*/

struct koeficijent
{
    int a,b;
};
struct duz
{
    int x1,x2,y1,y2;
    ll duzina;
    koeficijent k;

    duz()
    {

    }

    duz(int x1,int x2,int y1,int y2)
    {
        this->x1=x1;
        this->x2=x2;
        this->y1=y1;
        this->y2=y2;
        //duzina=calcLength();
        duzina=1ll*(x1-x2)*(x1-x2)+1ll*(y1-y2)*(y1-y2);
        k.a=y2-y1;
        k.b=x2-x1;

        if(k.b<0)
        {
            k.a*=(-1);
            k.b*=(-1);
        }
        if(k.b==0) k.a=1;
        if(k.a==0) k.b=1;

        int gcd=__gcd(abs(k.a),k.b);
        k.a/=gcd; k.b/=gcd;

        /*for(int i=0; prosti[i]<=min(sqrt(abs(k.a)),sqrt(k.b))+1; ++i)
        {
            int p=prosti[i];
            while(k.a%p==0 && k.b%p==0)
            {
                k.a/=p;
                k.b/=p;
            }
        }*/
        //cout<<prikaz()<<endl;
    }

    ll calcLength() const
    {
        return (1ll*(x1-x2)*(x1-x2)+1ll*(y1-y2)*(y1-y2));
    }

    string prikaz(/*map<pii,string> &mapa*/)
    {
        //return mapa[pair<int,int>(x1,y1)]+mapa[pair<int,int>(x2,y2)];
        //cout<<mapa[pair<int,int>(x1,y1)]<<mapa[pair<int,int>(x2,y2)];
        return ("("+to_string(x1)+","+to_string(y1)+") ("+to_string(x2)+","+to_string(y2)+") K("+to_string(k.a)+","+to_string(k.b)+") D:"+to_string(duzina));
    }
};


void brute(vector<duz> &v, map<pii,string> &mapa)
{
    int ans=0;
    set<string> bilo;
    for(int i=0; i<v.size(); ++i)
    {
        for(int j=0; j<v.size(); ++j)
        {
            if(i==j) continue;
            string p="";
            /*p=v[i].prikaz(mapa)+v[j].prikaz(mapa);
            sort(begin(p),end(p));
            //cout<<"----"+p<<endl;
            bool ind=true;
            for(int i=0; i<3; ++i)
            {
                if(p[i]==p[i+1])
                {
                    ind=false;
                    break;
                }
            }
            if(!ind) continue;*/

            int l1=v[i].duzina, l2=v[j].duzina;
            double k1=(double)(v[i].y2-v[i].y1)/(double)(v[i].x2-v[i].x1);
            double k2=(double)(v[j].y2-v[j].y1)/(double)(v[j].x2-v[j].x1);
            if(abs(k1)==1/(double)0) k1=1/(double)0;
            if(abs(k2)==1/(double)0) k2=1/(double)0;
            //cout<<l1<<" ; "<<l2<<" ; "<<k1<<" ; "<<k2<<endl;
            if(l1==4*l2 && k1==k2 && bilo.count(p)==0)
            {
                bilo.insert(p);
                ans++;
                //cout<<v[i].prikaz(mapa)+"-"+v[j].prikaz(mapa)<<endl;
            }
        }
    }
    cout<<"Brute:"<<ans;
}

struct anStruct
{
    int ka,kb;
    ll duzina;

    anStruct(int ka, int kb, ll duzina)
    {
        this->ka=ka;
        this->kb=kb;
        this->duzina=duzina;
    }
};

struct comp
{
    bool operator()(const anStruct &x, const anStruct &y) const
    {
        if(x.ka<y.ka) return true;
        if(x.ka>y.ka) return false;

        if(x.kb<y.kb) return true;
        if(x.kb>y.kb) return false;

        return x.duzina<y.duzina;
    }
};

int main()
{
    juseinbolt;

    //sieve(sqrt(2e8)+5);
    //for(auto x:prosti) cout<<x<<" "; return 0;

    int n=1500;
    cin>>n;
    //vector<duz> duzi(n*(n-1)/2);
    vector<pii> tacke(n);

    for(int i=0; i<n; ++i)
    {
        cin>>tacke[i].first>>tacke[i].second;
    }

    /*for(int i=0; i<n; ++i)
    {
        tacke[i].first=i;
        tacke[i].second=i*i;
    }*/

    //int dcnt=0;
    map<anStruct,int,comp> histori;
    for(int i=0; i<n; ++i)
    {
        for(int j=i+1; j<n; ++j)
        {
            duz novaDuz(tacke[i].first,tacke[j].first,tacke[i].second,tacke[j].second);
            //duzi.PB(novaDuz);
            histori[anStruct(novaDuz.k.a,novaDuz.k.b,novaDuz.duzina)]++;
            //duzi[dcnt]=novaDuz;
            //dcnt++;
        }
    }

    ll ans=0;
    for(int i=0; i<n; ++i)
    {
        for(int j=i+1; j<n; ++j)
        {
            duz d(tacke[i].first,tacke[j].first,tacke[i].second,tacke[j].second);
            ans+=histori[anStruct(d.k.a,d.k.b,4*d.duzina)];
        }
    }
    /*for(auto d:duzi)
    {
        ans+=histori[tuple<int,int,ll>(d.k.a,d.k.b,4*d.duzina)];
    }*/
    cout<<ans;

    return 0;
}