#include <iostream>
#include <vector>
#include <deque>
// #include <set>
#include <algorithm>
#include <cmath>
// #include <queue>

using namespace std;

struct tacka {
    int x = 0;
    int y = 0;
};

struct osnovica {
    tacka t1;
    tacka t2;
    double duzina;
    float k = 0;
};

tacka tacke[1505];

osnovica osnovice[1500*1500+5];


bool compOs(osnovica a, osnovica b) {
    return a.k < b.k;
}

int main() {
	
    int n;
    cin >> n;

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

    for (int i = 0; i < n; i++) {
        //cout << tacke[i].x << " ";
        //cout << tacke[i].y << endl;
    }

    //cout << endl;

    int br = 0;

    for (int i = 0; i < n; i++) {
        for (int j = i+1; j < n; j++) {
            //cout << i << " " << j << endl;
            osnovice[br].t1 = tacke[i];
            osnovice[br].t2 = tacke[j];
            if (abs(tacke[i].y - tacke[j].y) == 0)
                osnovice[br].k = -141.42;
            else
                osnovice[br].k = (tacke[i].x - tacke[j].x) / (float)(tacke[i].y - tacke[j].y);

            osnovice[br].duzina = sqrt(pow(abs(tacke[i].x - tacke[j].x), 2) + pow(abs(tacke[i].y - tacke[j].y), 2));
            br++;
        }
    }

    //cout << "br = " << br << endl;

    for (int i = 0; i < br; i++) {
        // cout << osnovice[i].t1.x << " " << osnovice[i].t1.y << endl;
        // cout << osnovice[i].t2.x << " " << osnovice[i].t2.y << endl;
        //cout << "k = " << osnovice[i].k << endl;
    }

    sort(osnovice, osnovice + br, compOs);

    //cout << "--- " << endl;

    vector<int> trenutni;

    int ans = 0;

    for (int i = 1; i < br; i++) {
        
        //cout << osnovice[i].t1.x << " " << osnovice[i].t1.y << " | " << osnovice[i].t2.x << " " << osnovice[i].t2.y << endl;
        
        if (osnovice[i].k == osnovice[i-1].k) {
            trenutni.push_back(i-1);
        } else {
            if (trenutni.size() > 0) {
                trenutni.push_back(i-1);

                for (auto x : trenutni) {
                    //cout << x << endl;
                    //cout << "d = " << osnovice[x].duzina << endl;

                    //cout << "k = " << osnovice[x].k << endl;

                }

                //cout << endl << endl;

                for (int j = 0; j < trenutni.size(); j++) {
                    for (int m = j+1; m < trenutni.size(); m++) {
                        if (osnovice[trenutni[j]].duzina == 2 * osnovice[trenutni[m]].duzina or 2 * osnovice[trenutni[j]].duzina == osnovice[trenutni[m]].duzina) {
                            // cout << osnovice[trenutni[j]].t1.x << " " << osnovice[trenutni[j]].t1.y << " " << osnovice[trenutni[j]].t2.x << " " << osnovice[trenutni[j]].t2.y << endl;
                            // cout << osnovice[trenutni[m]].t1.x << " " << osnovice[trenutni[m]].t1.y << " " << osnovice[trenutni[m]].t2.x << " " << osnovice[trenutni[m]].t2.y << endl;
                            ans++;
                            //cout << trenutni[j] << " " << trenutni[m] << endl;
                        }
                    }
                }

                trenutni.clear();

            }
        }

        //cout << endl << "k = " << osnovice[i].k << endl;
    }


    //cout << "ANS  = " << ans << endl;
    cout << ans << endl;


	return 0;
}