#include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for (int i=a; i<b; i++)
#define endl '\n'
#define X real()
#define Y imag()
typedef long long ll;
typedef complex<ll> point;

bool por(const point &p1, const point &p2){
    if (p1.X == p2.X) return p1.Y < p2.Y;
    return p1.X < p2.X;
}

void solve(){
    int n; cin >> n;
    point tacke[n];
    ll x, y;
    REP(i, 0, n){
        cin >> x >> y;
        tacke[i] = point(x, y);
    }
    sort(tacke, tacke + n, por);

    map<pair<ll, ll>, int> m;
    point v;
    ll ans = 0;
    REP(i, 0, n - 1)
        REP(j, i + 1, n){
            v = tacke[j] - tacke[i];
            if (v.X <= LLONG_MAX / 2 && v.Y <= LLONG_MAX / 2)
                ans += m[make_pair(v.X * 2, v.Y * 2)];
            if ((v.X & 1) == 0 && (v.Y & 1) == 0)
                ans += m[make_pair(v.X / 2, v.Y / 2)];
            ++m[make_pair(v.X, v.Y)];
        }
    cout << ans << endl;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int t=1;// cin>>t;
    REP(i, 0, t) solve();

    return 0;
}