#include <bits/stdc++.h>
#define ll long long
#define MAXN 1510
using namespace std;
map<double,vector<double> > m;
vector<pair<ll,ll> > v;
vector<double> py,a;
ll x[MAXN],y[MAXN];
bool Check(double d)
{
    ll l=0,r=a.size()-1,mid;
    while (l<=r)
    {
        mid=(l+r)/2;
        if (a[mid]==d)
            return true;
        if (a[mid]>d)
            r=mid-1;
        else
            l=mid+1;
    }
    return false;
}
int main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    ll n,cnt=0;
    cin >> n;
    for (ll i=1;i<=n;i++)
    {
        cin >> x[i] >> y[i];
        v.push_back({x[i],y[i]});
    }
    sort(v.begin(),v.end());
    for (ll i=0;i<n;i++)
    {
        for (ll j=i+1;j<n;j++)
        {
            if (v[i].first==v[j].first)
            {
                py.push_back(abs(v[i].second-v[j].second));
                continue;
            }
            ll x1=v[i].first,y1=v[i].second,x2=v[j].first,y2=v[j].second;
            m[(double)((y2-y1)/(x2-x1))].push_back((double)(sqrt((y2-y1)*(y2-y1)+(x2-x1)*(x2-x1))));
        }
    }
    sort(py.begin(),py.end());
    a=py;
    for (ll i=0;i<a.size();i++)
    {
        if (Check(a[i]*2))
            cnt++;
    }
    for (auto it : m)
    {
        a=it.second;
        sort(a.begin(),a.end());
        for (ll i=0;i<a.size();i++)
        {
            if (Check(2*a[i]))
                cnt++;
        }
    }
    cout << cnt << "\n";
    return 0;
}