#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define INF (long long)1e18
#define MOD (long long)(1e9+7)
#define sz(x) ((int)x.size())
#define K int(12000)
#define X real()
#define Y imag()
#define F first
#define S second
#define EPS 1e-6
#define PI 3.141592
#define cross(a, b) (conj(a)*b).Y
#define MAN(a, b) norm(a-b)
#define EUC(a, b) abs(a-b)
#define PB push_back
#define REP(i, a, b) for (int i=a; i<b; i++)
#define RREP(i, a, b) for (int i=a; i>=b; i--)
#define heap priority_queue
typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef unsigned short us;
typedef complex<ll> point;
typedef tree<pair<int, int> , null_type, less<pair<int, int>>, rb_tree_tag,
        tree_order_statistics_node_update> indexed_set;

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

struct raz{ ll x, y; };

raz M(const point &p1, const point &p2){
    ll x = p1.Y - p2.Y,
        y = p1.X - p2.X;
    if (y == 0) x = 0;
    else if (x == 0) y = 0;
    if (y < 0) x *= -1, y *= -1;
    ll tmp = abs(__gcd(x, y));
    //cout << tmp;
    if (tmp) x /= tmp, y /= tmp;
    return {x, y};
}

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, cmp);

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

    //REP(i, 0, n)
    //    cout << tacke[i] << endl;
    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;
}