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

using namespace std;

void solve(){
	int n;
	cin>>n;
	int kordinate[n][n];
	for(int i=0; i<n; i++){
		cin>>kordinate[0][i];
		cin>>kordinate[1][i];
	}
	int out=0;
	
	for(int a=0; a<n; a++){
		for(int b=a+1; b<n; b++){
			for(int c=b+1; c<n; c++){
				for(int d=c+1; d<n; d++){
					double distancax1 = kordinate[0][a]-kordinate[0][b];
					double distancay1 = kordinate[1][a]-kordinate[1][b];
					double distanca = sqrt(distancax1*distancax1+distancay1*distancay1);
					double distancax2 = kordinate[0][c]-kordinate[0][d];
					double distancay2 = kordinate[1][c]-kordinate[1][d];
					double distanca2 =sqrt(distancax2*distancax2+distancay2*distancay2);

					if(distanca*2==distanca2 || distanca2*2==distanca){

						out++;
					}

				}

			}
		}
	}

	cout<<out;	

}


int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	solve();
   

	
}