#include <bits/stdc++.h>

typedef long long  ll;

using namespace std;

int n;
ll x, y;
pair <ll, pair<ll, ll>> duzi[1500000];
ll l[1500000];
pair <ll, ll> tacke[1600];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    cin >> n;
    for (ll i=0; i<n; i++)
        cin >> tacke[i].first >> tacke[i].second;
    int br = 0;
    for (ll i=0; i<n-1; i++){
        for (ll j=i+1; j<n; j++){
            duzi[br].first = (tacke[i].first-tacke[j].first)*(tacke[i].first-tacke[j].first) + (tacke[i].second-tacke[j].second)*(tacke[i].second-tacke[j].second);
            duzi[br].second.first = tacke[i].first-tacke[j].first;
            duzi[br].second.second = tacke[i].second-tacke[j].second;
            //cout << tacke[i].first << " " << tacke[i].second<< " "<< tacke[j].first << " " << tacke[j].second<< " "<< duzi[br].first << " " << duzi[br].second.first << " " << duzi[br].second.second << "\n";
            l[br] = duzi[br].first;
            br++;
        }
    }
    //cout << "ima ovoliko duzi:" << br << "\n";
    sort (duzi, duzi+br);
    sort (l, l+br);
    for (ll i=0; i<br; i++){
            //cout << duzi[i].first << " " << duzi[i].second.first << " " << duzi[i].second.second << "\n";
            //cout << l[i] << "\n";

    }
    int ukupno = 0;
    for (ll i=0; i<br; i++){
        for (ll j = lower_bound(l, l+br, l[i]*4)-l; j<upper_bound(l, l+br, l[i]*4)-l; j++){
            if ((duzi[i].second.first*duzi[j].second.second)==(duzi[i].second.second*duzi[j].second.first)) {
                ukupno++;
                //cout << duzi[i].second.first<< " " << duzi[i].second.second << " "<< duzi[j].second.first << " " << duzi[j].second.second<< "\n";
            }
        }
    }
    cout << ukupno;
    return 0;
}