#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;

typedef struct podaci
{
    float sloap;
    float length;
    //int a1, a2, b1, b2;
}data;

bool compare (data a, data b)
{
    if (a.sloap < b.sloap){
        return 1;
    }
    else{
        return 0;
    }
}
int main()
{
    int n, x[1500], y[1500];

    cin >> n;

    int velicina = n * (n - 1) / 2, counter = 0;

    data prava[velicina];

    for (int i = 0; i < n; i++){
        cin >> x[i] >> y[i];

    }

    for (int i = 0; i < n; i++){

        for (int j = i + 1; j < n; j++){
            if (x[i] == x[j]){
                prava[counter].sloap = sqrt(2);
            }
            else {
                prava[counter].sloap = (y[i] - y[j] * 1.00) / (x[i] - x[j]);
            }
            prava[counter].length = sqrt((y[i] - y[j]) * (y[i] - y[j]) + (x[i] - x[j]) * (x[i] - x[j]));
            /*prava[counter].a1 = x[i];
            prava[counter].a2 = y[i];
            prava[counter].b1 = x[j];
            prava[counter].b2 = y[j];*/
            counter++;
        }
    }
    /*for (int i = 0; i < velicina; i++){
        cout << prava[i].sloap << "(sloap), " << prava[i].length << "(length) tacke: " << prava[i].a1 << " i " << prava[i].a2 << " AND " << prava[i].b1 << " i " << prava[i].b2 << endl;
    }
    */
    sort (prava, prava + velicina, compare);
    /*
    cout << "===========" << endl;

    for (int i = 0; i < velicina; i++){
        cout << prava[i].sloap << "(sloap), " << prava[i].length << "(length) tacke: " << prava[i].a1 << " i " << prava[i].a2 << " AND " << prava[i].b1 << " i " << prava[i].b2 << endl;
    }
    */
    int start = 0, endd, count_that_shit = 0;

    for (int i = 0; i < velicina; i++){
        if (prava[i].sloap != prava[i + 1].sloap){
            endd = i + 1;
            //cout << "start: " << start << ", end: " << endd << endl;
            for (int p = start; p < endd; p++){
                for (int q = p; q < endd; q++){
                    if (prava[p].length == 2 * prava[q].length || prava[p].length * 2 == prava[q].length){
                        count_that_shit++;
                    }
                }
            }
            start = endd;
        }
    }
    cout << count_that_shit;



}