#define here cerr<<"---------------------------\n"
#include <chrono>
using namespace std::chrono;
#define vremestart auto start = high_resolution_clock::now();
#define vremeend auto stop = high_resolution_clock::now();
#define vremeispis auto duration = duration_cast<microseconds>(stop - start); cout << duration.count() << endl;
#include <bits/stdc++.h>
#define ld double
#define ll long long
#define ull unsigned long long
#define llinf 100000000000000000LL // 10^17
#define iinf 2000000000 // 2*10^9
#define pb push_back
#define popb pop_back
#define fi first
#define sc second
#define endl '\n'
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pld pair<ld,ld>
#define sz(a) int(a.size())
#define all(a) a.begin(),a.end()
using namespace std;
#define maxn 1505
ll n;
pll a[maxn];
ll gcd(ll a, ll b)
{
   if(b==0) return a;
   if(a==0) return b;
   if(a>=b)  return gcd(a%b,b);
   return  gcd(a,b%a);
}
ll f(ll x){return x*x;}
ll len(pll a,pll b){
    return f(a.fi-b.fi) + f(a.sc-b.sc);
}
ll ans = 0;
int main(){
	ios_base::sync_with_stdio(false);cerr.tie(0);cout.tie(0);cin.tie(0);
    cin >> n;
    for(ll i = 1;i<=n;i++){
        cin >> a[i].fi >> a[i].sc;
    }
    //vremestart
    vector<pair<pll,ll> > v;
    for(ll i = 1;i<=n;i++){
        for(ll j = i+1;j<=n;j++){
            ll p1 = abs(a[i].fi-a[j].fi);
            ll p2 = abs(a[i].sc-a[j].sc);
            if(p1==0&&p2==0) continue;
            ll d = gcd(p1,p2);
            p1/=d;
            p2/=d;
            if(p1==0) p2 = -1;
            else if(p2==0) p1 = -1;
            else{
                pll x = a[i];
                pll y = a[j];
                if(x.fi>y.fi) swap(x,y);
                if(x.sc<y.sc) p1*=-1;
            }
            v.pb({{p1,p2},(a[i].fi-a[j].fi)*(a[i].fi-a[j].fi)+(a[i].sc-a[j].sc)*(a[i].sc-a[j].sc)});
        }
    }
    sort(all(v));
    //for(duz x : v) cerr<<x.fi<< " "<<x.sc<< " "<<x.x<<endl;
    pll p;
    if(sz(v)) p = {v[0].fi.fi,v[0].fi.sc};
    ll last = 0;
    ll m = sz(v);
    for(ll i = 1;i<m;i++){
        if(v[i].fi.fi!=p.fi||v[i].fi.sc!=p.sc){
            map<ll,ll> mp;
            for(ll j = last;j<i;j++){
                mp[v[j].sc]++;
                if(v[j].sc%4==0) ans+= mp[v[j].sc/4];
                ans+=mp[v[j].sc*4];
            }
            /*for(auto f : mp){
                ans+=f.sc*mp[4*f.fi];
            }*/
            last = i;
            p = {v[i].fi.fi,v[i].fi.sc};
        }
    }
    map<ll,ll> mp;
    for(ll j = last;j<m;j++){
        mp[v[j].sc]++;
        if(v[j].sc%4==0) ans+= mp[v[j].sc/4];
        ans+=mp[v[j].sc*4];
    }
    cout<<ans<<endl;
    //vremeend
    //vremeispis
	return 0;
}