#include <iostream>
#include <vector>
#include <map>
#include <cmath>

using namespace std;

int main()
{
    int N;
    cin >> N;
    int ucenici[N][2] = {};
    map<double, vector<double>> ivice;
    vector<double> xivice;
    long long brojTrapeza = 0;

    for(int i = 0; i < N; i++){
        int x, y;
        cin >> x >> y;
        ucenici[i][0] = x;
        ucenici[i][1] = y;

        for(int a = 0; a < i; a++){
            double k;
            double l = sqrt(pow(ucenici[i][1] - ucenici[a][1], 2) + pow(ucenici[i][0] - ucenici[a][0], 2));
            if(ucenici[i][0] != ucenici[a][0])
            {
                k = (double)(ucenici[i][1] - ucenici[a][1]) / (ucenici[i][0] - ucenici[a][0]);
                if(ivice.find(k) == ivice.end()) ivice.insert({k, vector<double>()});

                for(int b = 0; b < ivice.at(k).size(); b++) if(ivice.at(k).at(b) == 2 * l || ivice.at(k).at(b) == l/2) brojTrapeza++;

                ivice.at(k).push_back(l);
            }
            else {
                for(int b = 0; b < xivice.size(); b++) if(xivice.at(b) == 2 * l || xivice.at(b) == l/2) brojTrapeza++;
                xivice.push_back(l);
            }
        }
    }
    cout << brojTrapeza;
}