#include <bits/stdc++.h>
using namespace std;

//      Starting Kit     (START)
typedef long long ll;
#define INF INT_MAX
#define MOD (1e9+7)

#define pii pair<int, int>
#define mp make_pair

#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vb vector<bool>
#define vs vector<string>
#define vvi vector<vi>
#define vii vector<pii>
#define pb push_back
#define print_vect(v) for (auto it : v) cout << it << " ";
//      Starting Kit     (END)

struct Point {
double x, y;};

struct Duz {
Point p1, p2;
double k;};

double dist2(Point a, Point b) { return sqrt( abs(a.x-b.x)*abs(a.x-b.x) + abs(a.y-b.y)*abs(a.y-b.y) ); }

double nagib(Point A, Point B) {
    double k;
    if (B.x-A.x != 0)
        k = (B.y-A.y)/(B.x-A.x);
    else
        k = abs((B.y-A.y)/(B.x-A.x));
return (k);
}

bool isParallel(Point A, Point B, Point D, Point C) {
    double k1 = (B.y-A.y)/(B.x-A.x);
    double k2 = (D.y-C.y)/(D.x-C.x);
    if (k1 == k2) return true;
    return false;
}


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n; cin >> n;
    vector<Point> points(n);

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

    if (n < 90) { // Brute force solution
        int sol = 0;
        for (int i = 0; i < n; ++i)
        for (int j = i+1; j < n; ++j)
        for (int k = j+1; k < n; ++k)
        for (int l = k+1; l < n; ++l) {
            Point A = points[i];
            Point B = points[j];
            Point C = points[k];
            Point D = points[l];

            if (isParallel(A, B, D, C)) {
                double d1 = dist2(A, B);
                double d2 = dist2(D, C);
                if (d1 > d2) swap(d1, d2);
                if (d1*2==d2) ++sol;
            }
            else if (isParallel(A, D, B, C)) {
                double d1 = dist2(A, D);
                double d2 = dist2(B, C);
                if (d1 > d2) swap(d1, d2);
                if (d1*2==d2) ++sol;
            }
            else if (isParallel(A, C, B, D)) {
                double d1 = dist2(A, C);
                double d2 = dist2(B, D);
                if (d1 > d2) swap(d1, d2);
                if (d1*2==d2) ++sol;
            }
        }


        cout << sol << endl;
    }
    else { // solution with sorting by k

        vector<Duz> duzi;
        for (int i = 0; i < n; ++i) {
            for (int j = i+1; j < n; ++j) {
                duzi.push_back({points[i], points[j], nagib(points[i], points[j])});
            }
        }


        sort(duzi.begin(), duzi.end(), [](const Duz &d1, const Duz &d2) {
                return d1.k < d2.k;
            });

        /*for (auto duz : duzi) {
            cout << duz.p1.x << ", " << duz.p1.y << "   " << duz.p2.x << ", " << duz.p2.y << "  ->   ";
            cout << duz.k << endl;
        }*/

        int sol = 0;
        for (int i = 0; i < duzi.size(); ++i) {
            Duz d = duzi[i];
            double k = d.k;

            int j = i+1;
            while (j < duzi.size() && duzi[j].k == d.k) {
                double d1 = dist2(d.p1, d.p2);
                double d2 = dist2(duzi[j].p1, duzi[j].p2);
                if (d1 > d2) swap(d1, d2);
                if (d1*2==d2)
                    ++sol;

                ++j;
            }
        }

        cout << sol << endl;
    }

    return 0;
}