#include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update> order_set;

const int mxN = 1e5+5;
const int mod = 1e9+7;
const int mxlogN = 20;
const int mxK = 52;
ll x[mxN], y[mxN];
ll gcd(ll a, ll b)
{
    if(b==0) return a;
    return gcd(b, a%b);
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n; cin >> n;
    for(int i = 0; i < n; i++)
    {
        cin >> x[i] >> y[i];
    }
    vector<pair<pair<int, int>, ll>> a;
    for(int i = 0; i < n; i++)
    {
        for(int j = i+1; j < n; j++)
        {
            ///ugao = ydif/gcd(ydif,xdif), xdif/gcd(ydif,xdif)
            ll ydif = abs(y[j]-y[i]), xdif = abs(x[j]-x[i]);
            int gc = gcd(ydif, xdif);
            a.push_back({{ydif/gc, xdif/gc}, ydif*ydif+xdif*xdif});
        }
    }
    sort(a.begin(), a.end());
    int ans = 0;
    for(int i = 0; i < a.size(); i++)
    {
        auto x = a[i];
        x.second *= 4;
        auto it = lower_bound(a.begin(), a.end(), x);
        if(it!=a.end() && x == *it) ans++;
    }
    cout << ans << "\n";
}