#include <iostream>
#include <cmath>
using namespace std;

int main(){
    int n; cin>>n;
    long int x[n];
    long int y[n];
    int kontrolor= 0;
    for(int i = 0; i<n; i++){
        cin>>x[i];
        cin>>y[i];
        long int distance[i] = sqrt(pow(x2-x1,2) + pow(y2-y1, 2));
    }
    for(int i=0; i<n-1; i++){
        for(int j=0; j<n; j++){
            if(distance[i]%distance[j] == distance[i]/ 2 || 
            distance[j]%distance[i] == distance[j]/ 2){
                kontrolor++;
            }
        }
    }
    cout<<kontrolor;
}