#include <bits/stdc++.h>
#define MAXN 1510
#define fi first
#define se second
using namespace std;

int x[MAXN], y[MAXN];
map<pair<int, int>, vector<int>> mapa;
unordered_map<int, int> mapa2;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
    {
        cin >> x[i] >> y[i];
    }
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            if(i != j && (x[i] < x[j] || (x[i] == x[j] && y[i] < y[j])))
            {
                int dx = x[j] - x[i];
                int dy = y[j] - y[i];
                int d = __gcd(abs(dx), abs(dy));
                mapa[{dx/d, dy/d}].push_back(abs(dx) + abs(dy));
            }
        }
    }
    long long res = 0;
    for(auto a : mapa)
    {
        //cout << a.fi.fi << ", " << a.fi.se << ": " << a.se.size() << endl;
        for(auto x : a.se)
        {
            //cout << "  " << x << endl;
            res += mapa2[2*x];
            if(x % 2 == 0) res += mapa2[x/2];
            mapa2[x]++;
        }
        mapa2.clear();
    }
    cout << res << endl;

    return 0;
}


/**

8
4 7
7 1
1 5
7 5
10 10
4 14
12 6
12 8

9
4 7
7 1
1 5
7 5
10 10
4 14
11 1
12 6
12 8



*/