#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Prava
{
	unsigned long long int duzina;
	long long int x1,y1,x2,y2;
};

bool cmp(Prava a, Prava b)
{
	return a.duzina<b.duzina;
}

int main(int argc, char** argv) {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	unsigned long long int n;
	cin >>n;
	long long int x[n];
	long long int y[n];
	for(unsigned long long int i=0;i<n;i++)
	{
		cin >>x[i]>>y[i];
	}
	if(n<4)
	{
		cout <<0<<"\n";
	}
	else
	{
		vector<Prava> v(n*(n-1)/2);
		unsigned long long int z=0;
		for(unsigned long long int i=0;i<n-1;i++)
		{
			for(unsigned long long int j=i+1;j<n;j++)
			{
				v[z].duzina=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
				v[z].x1=x[i];
				v[z].y1=y[i];
				v[z].x2=x[j];
				v[z].y2=y[j];
				z++;
			}
		}
		unsigned long long int br=0;
		sort(v.begin(),v.end(),cmp);
		unsigned long long int l=0,r=1;
		
		while(l!=v.size() && r!=v.size())
		{
			if(v[l].duzina*4==v[r].duzina)
			{
				if((v[l].x1 == v[r].x1 && v[l].y1 == v[r].y1 ) || (v[l].x2 == v[r].x2 && v[l].y2 == v[r].y2 ) || (v[l].x1 == v[r].x2 && v[l].y1 == v[r].y2 ) || (v[l].x2 == v[r].x1 && v[l].y2 == v[r].y1 ))
				{
			    }
			    else
			    {
			    	br++;
				}
				r++;
			}
			else if(v[l].duzina*4>v[r].duzina)
			{
				r++;
			}
			else
			{
				l++;
			}
		}
		cout <<br<<"\n";
	}
	
	return 0;
}