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

using namespace std;

int main()
{
    int n, c=0;
    cin >> n;
    int s = n*(n-1)/2;
    double p[n][2]={{0}};
    double l[s][s+3]={{0}};

    for(int i=0; i<n; i++){
        cin >> p[i][0] >> p[i][1];
        double x=p[i][0];
        double y=p[i][1];
        
        for(int j=0; j<i; j++){
            double x1 = p[j][0];
            double y1 = p[j][1];
            
            double slope = (y1-y)/(x1-x);
            double slength = (y1-y)*(y1-y)+(x1-x)*(x1-x);
            
            for(int k=0; k<s; k++){
                int temp=l[k][1];
                if(isinf(slope)){
                    if(isinf(l[k][0])){
                        l[k][temp+2]=slength;
                        for(int ajj=0; ajj<temp; ajj++){
                            if(slength==l[k][ajj+2]*4 || slength*4==l[k][ajj+2]){
                                c++;
                            }
                        }
                        l[k][1]++;
                        break;
                    }
                    else if(l[k][1]==0){
                        l[k][0]=slope;
                        l[k][1]=1;
                        l[k][2]=slength;
                        break;
                    }
                }
                else{
                if(l[k][0]==slope){
                    l[k][temp+2]=slength;
                    for(int ajj=0; ajj<temp; ajj++){
                        if(slength==l[k][ajj+2]*4 || slength*4==l[k][ajj+2]){
                            c++;
                        }
                    }
                    l[k][1]++;
                    break;
                }
                else if(l[k][1]==0){
                    l[k][0]=slope;
                    l[k][1]=1;
                    l[k][2]=slength;
                    break;
                }
                }
            }
        }
    }

    cout << c;

    return 0;
}