#include<bits/stdc++.h>
using namespace std;
int N;
vector <long long int> X;
vector <long long int> Y;
vector <double> niz1;
vector <double> niz2;
double matr[1501][1501];
double duz [1501][1501];
bool compared(double a, double b, double e=0.001f)
{
    if (abs(a-b)<e)
        return true;
    return false;
}
void quicksort1(int l, int d)
{
    int i,j;
    i=l;
    j=d;
    if(l>=d)
        return;
    while(j>i)
    {
        while(niz1[d]>niz1[i])
            i++;
        while(j>i && niz1[d]<=niz1[j])
            j--;
        swap(niz1[i],niz1[j]);
        swap(niz2[i],niz2[j]);
    }
    swap(niz1[i],niz1[d]);
    swap(niz2[i],niz2[d]);
    quicksort1(l,i-1);
    quicksort1(i+1,d);
}
void unos()
{
    cin>>N;
    for (int i=0; i<N; i++)
    {
        long long int a,b;
        cin>>a>>b;
        X.push_back(a);
        Y.push_back(b);
    }
}
void rez()
{
    int brojac=0;
    memset(matr,0,sizeof matr);
    memset(duz,0,sizeof duz);
    for(int i=0; i<N; i++)
        for(int j=i+1; j<N; j++)
        {
            if (X[j]-X[i]==0)
            {
                duz[i][j]=abs(Y[i]-Y[j]);
                matr[i][j]=numeric_limits<int>::max();
            }
            else
            {
                duz[i][j]=sqrt((Y[i]-Y[j])*(Y[i]-Y[j])+(X[i]-X[j])*(X[i]-X[j]));
                matr[i][j]=(Y[j]-Y[i])/(X[j]-X[i]);
            }
        }
    for(int i=0; i<N; i++)
        for(int j=i+1; j<N; j++)
            niz1.push_back(matr[i][j]);
    for(int i=0; i<N; i++)
        for(int j=i+1; j<N; j++)
            niz2.push_back(duz[i][j]);
    quicksort1(0,niz1.size()-1);
    int l=0,d=1;
    for(int i=1; i<niz1.size(); i++)
    {
        if (d>1 && niz1[i]!=niz1[i-1])
        {
            vector <double> n1;
            vector <double> n2;
            for(int j=0; j<d; j++)
                n1.push_back(niz2[l+j]);
            sort(n1.begin(),n1.end());
            for(int j=0; j<n1.size(); j++)
                n2.push_back(n1[j]*2);
            int ind1=0,ind2=0;
            while(ind1!=n1.size()&&ind2!=n1.size())
            {
                if (compared(n1[ind1],n2[ind2]))
                {
                    brojac++;
                    ind1++;
                    ind2++;
                }
                while(n1[ind1]<n2[ind2] && ind1!=n1.size())
                    ind1++;
                while(n1[ind1]>n2[ind2] && ind2!=n1.size())
                    ind2++;
            }
        }
        if (niz1[i]==niz1[i-1])
        {
            d++;
        }
        else
        {

            l=i;
            d=1;
        }
    }
    if (d>1)
    {
        vector <double> n1;
        vector <double> n2;
        for(int j=0; j<d; j++)
            n1.push_back(niz2[j+l]);
        sort(n1.begin(),n1.end());
        for(int j=0; j<n1.size(); j++)
            n2.push_back(n1[j]*2);
        int ind1=0,ind2=0;
        while(ind1!=n1.size()&&ind2!=n1.size())
        {
            if (abs(n1[ind1]-n2[ind2])<0.1)
            {
                brojac++;
                ind1++;
                ind2++;
            }
            while(n1[ind1]<n2[ind2] && ind1!=n1.size())
                ind1++;
            while(n1[ind1]>n2[ind2] && ind2!=n1.size())
                ind2++;
        }
    }
    cout<<brojac;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    unos();
    rez();
}