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

struct t {
	long long x, y;
};
struct l{
	long long x, y;
};

int n;
t tacke[1505];
l linije[2000005];
int nL;
int sum;

int main()
{
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
	{
		scanf("%lld %lld", &tacke[i].x, &tacke[i].y);
	}
	for (int i = 0; i < n; ++i)
	{
		for (int j = i+1; j < n; ++j)
		{
			linije[nL].x = tacke[i].x - tacke[j].x;
			linije[nL].y = tacke[i].y - tacke[j].y;
			if (tacke[i].x < tacke[j].x || tacke[i].x == tacke[j].x && tacke[i].y < tacke[j].y) {
				linije[nL].x = -linije[nL].x;
				linije[nL].y = -linije[nL].y;
			}
			//cout << "linija " << linije[nL].x << " - " << linije[nL].y << endl;
			//cout << "izmedju " << tacke[i].x << ", " << tacke[i].y;
			//cout << " i " << tacke[j].x << ", " << tacke[j].y << endl;
			++nL;
		}
	}

	for (int i = 0; i < nL; ++i)
	{

		for (int j = i+1; j < nL; ++j)
		{

			if ((linije[i].x*2 == linije[j].x && linije[i].y*2 == linije[j].y)
				|| (linije[i].x == linije[j].x*2 && linije[i].y == linije[j].y*2))
			{
				++sum;
			}
		}
	}
	printf("%d\n", sum);
	return 0;
}