#include <iostream>
#include <bits/stdc++.h>

using namespace std;

double koef(pair<int,int> x, pair<int,int> y) {
	return (double)(x.second-y.second)/(double)(x.first-y.first);
}

double duzina(pair<int,int> x, pair<int,int> y) {
	double d = sqrt((x.first-y.first)*(x.first-y.first)+(x.second-y.second)*(x.second-y.second));
	int a = d*1000000;
	a /= 10;
	return (double)a/100000;
}

void solve(){
	int n;
	scanf("%d", &n);
	vector<pair<int,int>> tacke;
	for(int i = 0; i < n; i++) {
		int x,y;
		scanf("%d %d", &x, &y);
		tacke.push_back(make_pair(x,y));
	}
	vector<pair<double, double>> duz;
	vector<double> vert;
	for(int i = 0; i < n - 1; i++) {
		for(int j = i + 1; j < n; j++) {
			if(tacke[i].first == tacke[j].first)
				vert.push_back(duzina(tacke[i], tacke[j]));
			else
				duz.push_back(make_pair(koef(tacke[i],tacke[j]),duzina(tacke[i],tacke[j])));
		}
	}
	sort(duz.begin(),duz.end());
	int d = 0;
	for(int i = 0; i < duz.size() - 1; i++){
		if(duz[i].first == duz[i+1].first) {
			int j = i + 1;
			while(duz[i].first == duz[j].first){
				if(duz[i].second == 2*duz[j].second || 2*duz[i].second == duz[j].second)
					d++;
				j++;
			}
		}
	}
	for(int i = 0; i < vert.size() - 1; i++){
		for(int j = i + 1; j < vert.size(); j++)
			if(vert[i] == 2 * vert[j] || vert[i] * 2 == vert[j])
				d++;
	}
	printf("%d",d);
}

int main(int argc, char** argv) {
	//auto start = std::chrono::high_resolution_clock::now();
	//freopen("input.txt", "r", stdin);
	solve();
	//auto finish = std::chrono::high_resolution_clock::now();
	//std::chrono::duration<double> elapsed = finish - start;
	//std::cout << "\nElapsed time: " << elapsed.count() << " s\n";
	return 0;
}