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

bool cmp(pair<int,int> l,pair<int,int> m)
{

	if (l.second * m.first >= m.second * l.first) return false;
	return true;
}

int main()
{
    int Brojac=0;
	int n,cnt=0,pomocni=0;
	cin>>n;
	vector<pair<int,int>> a;
	vector<pair<int,int>> b;
	int x[n],y[n];
	for(int i=0;i<n;i++)
	{
		cin>>x[i]>>y[i];
	}
	for(int i =0;i<n;i++)
	{
		for(int j=i+1;j<n;j++)
		{
            if(x[i]!=x[j])
            {
               a.push_back ( make_pair (abs(x[i]-x[j]),abs(y[i]-y[j])));
               cnt++;
            }
            else
            {
                b.push_back( make_pair (abs(x[i]-x[j]),abs(y[i]-y[j])));
                pomocni++;
            }
		}
	}
	sort(a.begin(),a.end(),cmp);
	for(int i=0;i<cnt;i++)
	{
		for(int j=i+1;j<cnt;j++)
		{
			if(a[i].second*a[j].first==a[j].second*a[i].first)
			{
				if(4*(a[i].first*a[i].first+a[i].second*a[i].second)==(a[j].first*a[j].first+a[j].second*a[j].second)) Brojac++;
				if((a[i].first*a[i].first+a[i].second*a[i].second)==4*(a[j].first*a[j].first+a[j].second*a[j].second)) Brojac++;
			}
            else j=cnt;
		}
	}
	for(int i=0;i<pomocni;i++)
    {

        for(int j=i+1;j<pomocni;j++)
        {
            if((2*b[i].second==b[j].second)||(b[i].second==2*b[j].second))
                Brojac++;
        }
    }
	cout<<Brojac;
}