#include<bits/stdc++.h>
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define dec(x, y) fixed << setprecision((y)) << (x)
#define xx first
#define yy second
#define srt(v) sort((v).begin(), (v).end())
#define srtr(v) sort((v).rbegin(), (v).rend())
#define pb push_back
#define popb pop_back
#define sz(a) (int)(a).size()
#define len(a) (int)(a).length()
#define mp make_pair

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int n, br;
vector<pll> tac;
vector<pair<ll, pll>> v;
bool comp(const pair<ll, pll>& A, const pair<ll, pll>& B) {
    if(A.xx!=B.xx) return A.xx<B.xx;
    return (A.yy.xx==0LL?2000000000.0:(double)A.yy.yy/(double)A.yy.xx)<(B.yy.xx==0LL?2000000000.0:(double)B.yy.yy/(double)B.yy.xx);
}
int lb(int tl, int tr, const ll& val) {
    if(tl==tr) return tl;
    int mid=(tl+tr)/2;
    if(v[mid].xx>=val) return lb(tl, mid, val);
    return lb(mid+1, tr, val);
}
int main() {
    ios;
    cin >> n;
    tac.resize(n);
    for(int i=0; i<n; i++) {
        cin >> tac[i].xx >> tac[i].yy;
    }
    for(int i=0; i<n; i++) {
        for(int j=i+1; j<n; j++) {
            ll pr=tac[j].xx-tac[i].xx;
            ll dr=tac[j].yy-tac[i].yy;
            v.pb({pr*pr+dr*dr, {pr, dr}});
        }
    }
    sort(v.begin(), v.end(), comp);
    //for(auto x:v) cout << x.xx << ' ' << x.yy.xx << ' ' << x.yy.yy << endl;
    int j=-1;
    for(int i=0; i<sz(v)-1; i++) {
        if(i==0 || v[i].xx!=v[i-1].xx) j=lb(i+1, sz(v)-1, 4LL*v[i].xx);
        int jj=2000000000;
        bool uzeo=false;
        for(; v[j].xx==4LL*v[i].xx; j++) {
            ll pr=v[i].yy.xx*v[j].yy.yy, dr=v[i].yy.yy*v[j].yy.xx;
            if(pr==dr) {
                uzeo=1;
                br++;
                jj=min(jj, j);
            }
            else if(abs(pr)==pr && abs(dr)!=dr) {
                break;
            }
            else if(abs(pr)>abs(dr)) {
                break;
            }
        }
        if(uzeo) j=jj;
    }
    cout << br;
    return 0;
}