// deo koda koji sam koristio za binarnu pretragu sam uzeo sa sajta https://www.geeksforgeeks.org/find-first-and-last-positions-of-an-element-in-a-sorted-array/

#include <bits/stdc++.h>
using namespace std;
const double eps = 0.001;
const long long MAXN = 1500;
const long long MAXBR = (MAXN * (MAXN - 1)) / 2;
double distance(double x1, double y1, double x2, double y2){
    return sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2) * 1.0);
}
struct Par{
	double x1, y1, x2, y2;
	double dist;
};
bool compareDist(Par i1, Par i2){
    return (i1.dist - i2.dist < 0);
}
double x[MAXN], y[MAXN];
double xk1[MAXBR], yk1[MAXBR], xk2[MAXBR], yk2[MAXBR], rast[MAXBR];
Par niz[MAXBR];
long long first(double arr[], double x, long long n){
    long long low = 0, high = n - 1, res = -1;
    while (low <= high){
        long long mid = (low + high) / 2;
        if(abs(arr[mid] - x) < eps){
        	res = mid;
            high = mid - 1;
        }
        else if (arr[mid] > x)
            high = mid - 1;
        else if (arr[mid] < x)
            low = mid + 1;
    }
    return res;
}
long long last(double arr[], double x, long long n){
    long long low = 0, high = n - 1, res = -1;
    while (low <= high){
       	long long mid = (low + high) / 2;
        if (arr[mid] > x)
            high = mid - 1;
        else if (arr[mid] < x)
            low = mid + 1;
        else
        {
            res = mid;
            low = mid + 1;
        }
    }
    return res;
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cerr.tie(0); cout.tie(0);
	long long n;
	cin >> n;
	for(int i = 0; i < n; i++)
		cin >> x[i] >> y[i];
	long long res = 0;
	long long br = (n * (n - 1)) / 2;
	long long broji = 0;
	long long pom = 0;
	for(int i = 0; i < n - 1; i++){
		for(int j = i + 1; j < n; j++){
			niz[pom].x1 = x[i];
			niz[pom].x2 = x[j];
			niz[pom].y1 = y[i];
			niz[pom].y2 = y[j];
			niz[pom++].dist = distance(x[i], y[i], x[j], y[j]);
		}
	}
	sort(niz, niz + br, compareDist);
	/*for(int i = 0; i < br; i++)
		cout << niz[i].x1 << " " << niz[i].y1 << " " << niz[i].x2 << " " << niz[i].y2 << " " << niz[i].dist <<" " << endl;
	cout << endl << endl;*/
	for(int i = 0; i < br; i++){
		xk1[i] = niz[i].x1;
		yk1[i] = niz[i].y1;
		xk2[i] = niz[i].x2;
		yk2[i] = niz[i].y2;
		rast[i] = niz[i].dist;
	}
	/*for(int i = 0; i < br; i++)
		cout << xk1[i] << " " << yk1[i] << " " << xk2[i] << " " << yk2[i] << " " << rast[i] <<" " << endl;
	cout << endl << endl;*/
	long long resenje = 0;
	for(int i = 0; i < br; i++){
		double trazi = rast[i] + rast[i];
		double prvi = first(rast, trazi, br);
		double poslednji = last(rast, trazi, br);
		if(prvi != -1){
			for(int j = prvi; j <= poslednji; j++){
				if((xk1[i] == xk1[j] && yk1[i] == yk1[j]) || (xk1[i] == xk2[j] && yk1[i] == yk2[j]) || (xk2[i] == xk1[j] && yk2[i] == yk1[j]) || (xk2[i] == xk2[j] && yk2[i] == yk2[j]))
					continue;
				else{
					//cout << xk1[i] << " " << yk1[i] << " " << xk2[i] << " " << yk2[i] << " " << xk1[j] << " " << yk1[j] << " " << xk2[j] << " " << yk2[j] << " " << rast[i] << " " << rast[j] << endl;
					//prvi pokusaj
					if(((xk2[j] - xk1[j]) * (yk2[i] - yk1[i])) == ((xk2[i] - xk1[i]) * (yk2[j] - yk1[j]))){
						resenje++;
					}
				}
			}
		}
	}
	cout << resenje;
	return 0;
}