#include <bits/stdc++.h>
using namespace std;
long long x[1510], y[1510];
struct duz
{
    long long duzina;
    pair <long long, long long> ugao;
};
duz D1[2500000];
vector <duz> D2;
vector <long long> brp;
pair<long long, long long > skrati(pair<long long, long long> par)
{
    if(par.first < 0)
    {
        par.first = -par.first;
        par.second = -par.second;
    }
    long long nzd = __gcd(par.first, abs(par.second));
    return {par.first/nzd, par.second/nzd};
}
bool srt(duz a, duz b)
{
    if(a.ugao == b.ugao) return a.duzina < b.duzina;
    return a.ugao < b.ugao;
}
int main()
{
    ios_base::sync_with_stdio(false);
    long long n, i, j, k = 0, ans = 0;
    cin >> n;
    for(i = 0; i < n; i++) cin >> x[i] >> y[i];
    for(i = 0; i < n; i++)
        for(j = i + 1; j < n; j++)
        {
            D1[k].duzina = (y[i] - y[j])*(y[i] - y[j]) + (x[i] - x[j])*(x[i] - x[j]);
            D1[k].ugao = skrati({y[i] - y[j], x[i] - x[j]});
            k++;
        }
    sort(D1, D1 + k, srt);
    D2.push_back(D1[0]);
    brp.push_back(1);
    i = 1;
    while(i < k)
    {
        while(D1[i - 1].ugao == D1[i].ugao && D1[i - 1].duzina == D1[i].duzina)
        {
            i++;
            brp[brp.size() - 1]++;
        }
        D2.push_back(D1[i]);
        brp.push_back(1);
        i++;
    }
    j = 0;
    for(i = 0; i < D2.size(); i++)
    {
        while(D2[j].duzina < D2[i].duzina*4 && D2[j].ugao == D2[i].ugao)
        {
            j++;
        }
        if(D2[j].duzina == D2[i].duzina*4 && D2[j].ugao == D2[i].ugao)
            ans = ans + brp[i]*brp[j];
    }
    cout << ans;
    return 0;
}