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

using ll = long long;
using ld = long double;

const int N = 1500;

map <pair <pair <ll, ll>, ll>, int> ima;

ll x[N+5], y[N+5];

int tjm;

pair <ll, ll> koef(int i, int j){
    ll p = y[i] - y[j];
    ll q = x[i] - x[j];
    if(q == 0 && p == 0) return {0, 0};
    if(p == 0) return {0, 1};
    if(q == 0) return {1, 0};
    ll k = __gcd(abs(p), abs(q));
    p /= k;
    q /= k;
    if(q < 0) p = -p, q = -q;
    return {p, q};
}

ll dist(int i, int j){
    return (x[i] - x[j])*(x[i] - x[j]) + (y[i] - y[j])*(y[i] - y[j]);
}

int main(){
    ios_base::sync_with_stdio(false), cin.tie(0);
    cout.precision(10);
    cout << fixed;

    int n;
    cin >> n;
    for(int i=1; i<=n; i++) cin >> x[i] >> y[i];
    for(int i=1; i<=n; i++){
        for(int j=i+1; j<=n; j++){
            ima[{koef(i, j), dist(i, j)}]++;
        }
    }
    ll res = 0;
    for(int i=1; i<=n; i++){
        for(int j=i+1; j<=n; j++){
            ll k = 4*dist(i, j);
            res += ima[{koef(i, j), 4*dist(i, j)}];
        }
    }
    cout << res << "\n";
    return 0;
}