#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define xx first
#define yy second
#define ff(i,s,f) for(int i=s;i<f;i++)
#define fb(i,s,f) for(int i=(s)-1;i>=f;i--)
#define ffi(i,s,f) for(int i=s;i<=f;i++)
#define fbi(i,s,f) for(int i=s;i>=f;i--)
#define srt(a) sort(a.begin(),a.end());
#define srtg(a,int) sort(a.begin(),a.end(),greater<int>())
#define lb(a,x) lower_bound(a.begin(),a.end(),x)
#define ub(a,x) upper_bound(a.begin(),a.end(),x)
#define fnd(a,x) find(a.begin(),a.end(),x)
#define vstart auto startt=chrono::system_clock::now()
#define vend auto endd=chrono::system_clock::now()
#define vvreme chrono::duration<double> vremee=endd-startt
#define ios ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef string str;

const int maxn=1510;

pii niz[maxn];

void solve(){
    int n;
    cin>>n;
    ff(i,0,n) cin>>niz[i].xx>>niz[i].yy;
    int res=0;
    map<pii,int> mapa;
    ff(i,0,n){
        ff(j,i+1,n){
            int dx=niz[i].xx-niz[j].xx;
            int dy=niz[i].yy-niz[j].yy;
            if(dx==0){
                if(dy<0) dy*=-1;
            }else if(dx<0){
                dx*=-1;
                dy*=-1;
            }
            res+=mapa[mp(2*dx,2*dy)];
            if(dx%2==0 && dy%2==0) res+=mapa[mp(dx/2,dy/2)];
            mapa[mp(dx,dy)]++;
        }
    }
    cout<<res;
}

int main(){
    ios;
    int t=1;
    //cin>>t;
    while(t--) solve();
    return 0;
}