#include<bits/stdc++.h>
using namespace std;
int N;
vector <int> X;
vector <int> Y;
vector <int> niz1;
vector <int> niz2;
double matr[1501][1501];
double duz [1501][1501];
void unos()
{
    cin>>N;
    for (int i=0; i<N; i++)
    {
        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]);
    for(int i=0; i<niz1.size(); i++)
        for(int j=i+1; j<niz1.size(); j++)
            if (niz1[i]==niz1[j] && ((2*niz2[i]==niz2[j]) or (niz2[i]==2*niz2[j])))
                brojac++;
    cout<<brojac;
}
int main()
{
    unos();
    rez();
}