#include <iostream>
#include <algorithm>
#include <vector>
#include <limits>
#include <unordered_set>
#include <unordered_map>
#include <set>
#include <map>
#define forn(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
#define pll pair<ll, ll>
#define par pair<pll, pll>
using namespace std;
ll gcd(ll a, ll b) {
    return b == 0 ? a : gcd(b, a % b);
}
float k(par a) {
    ll y = a.first.second - a.second.second;
    ll x = a.first.first - a.second.first;
    ll g = gcd(abs(x), abs(y));
    y /= g;
    x /= g;
    if (x == 0) return numeric_limits<float>::infinity();
    return y / x;
}
ll d2(par a) {
    ll x = a.first.first - a.second.first;
    ll y = a.first.second - a.second.second;
    return x * x + y * y;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    vector<pll> tak(n);
    forn(i, n) {
        ll x, y;
        cin >> x >> y;
        tak[i] = {x, y};
    }
    vector<par> parovi;
    forn(i, n) forn(j, i) parovi.push_back({tak[i], tak[j]});
    unordered_map<float, unordered_multiset<ll>> prave;
    for (par p: parovi) {
        float f = k(p);
        prave[f].insert(d2(p));
    }
    ll bp = 0;
    for (auto pk: prave) {
        for (ll d: pk.second) bp += pk.second.count(d * 4);
    }
    cout << bp << endl;
    #ifdef CHUNGUS
    system("pause");
    #endif
}