#include <bits/stdc++.h>
using namespace std;

int X[1500], Y[1500];
map<pair<int, int>, int> dis;

int main() {
    int N, rez=0;
    cin>>N;
    for(int i=0; i<N; i++) {
        cin>>X[i]>>Y[i];
    }
    for(int i=0; i<N; i++) {
        for(int j=i+1; j<N; j++) {
            dis[make_pair(X[j]-X[i], Y[j]-Y[i])]++;
            dis[make_pair(X[i]-X[j], Y[i]-Y[j])]++;
            rez+=dis[make_pair(2*X[j]-2*X[i], 2*Y[j]-2*Y[i])];
            if((X[j]-X[i])%2==0&&(Y[j]-Y[i])%2==0)
                rez+=dis[make_pair((X[j]-X[i])/2, (Y[j]-Y[i])/2)];
        }
    }
    cout<<rez;
    return 0;
}