//
//  main.cpp
//  trapezi
//
//  Created by Sara on 28.11.21..
//

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
struct line{
    long long int k;
    long long int d;
};
bool sortLines(struct line l1, struct line l2){
    return (l1.k<l2.k);
}
int main(int argc, const char * argv[]) {
    long long unsigned int N,res=0;
    cin>>N;
    long long int x[N],y[N];
    for (auto i =0; i < N; i ++){
        cin>>x[i];
        cin>>y[i];
    }
    
    vector<line>lines;
    struct line Line;
    vector<long long int>undef,undefs;
    for (auto i =0; i < N; i ++){
        for (auto j=i+1; j<N; j ++){
            if (x[j]>x[i]){
                
                Line.k=(y[j]-y[i])/(x[j]-x[i]);
                Line.d=sqrt((x[i]-x[j])*(x[i]-x[j]) + (y[i]-y[j])*(y[i]-y[j]));
                lines.push_back(Line);
            }
            if (x[j]<x[i]){
                Line.k=(y[i]-y[j])/(x[i]-x[j]);
                Line.d=sqrt((x[i]-x[j])*(x[i]-x[j]) + (y[i]-y[j])*(y[i]-y[j]));
                lines.push_back(Line);
                
            }
            if (x[j]==x[i]){
                
                undef.push_back(i);
                undef.push_back(j);
                undefs.push_back(abs(y[j]-y[i]));
            }
        }
    }
    auto j=0;
    sort(undefs.begin(),undefs.end());
    for (auto i =0; i < undefs.size()-1; i ++){
        j=i+1;
        while (undefs[j]<=undefs[i]*2){
            if (undefs[j] == undefs[i]*2 && x[undef[i]]==x[undef[j]]){
                res++;
            }
            j++;
        }
    }
    sort(lines.begin(),lines.end(),sortLines);
    for (auto i =0; i < lines.size()-1; i ++){
        j=i+1;
        while (lines[i].k==lines[j].k){
            if (lines[i].d==lines[j].d*2 ||lines[j].d==lines[i].d*2){
                res++;
            }
            j++;
        }
    }
    cout<<res<<endl;
    
    return 0;
}