#include <bits/stdc++.h>

using namespace std;

struct Point{
    long long x,y;
};
struct Distance{
    double y;
    long long x;
};
int main()
{


    int n, br = 0;
    map<long long, set<long long> > mp;
    cin >> n;
    Point p[n];
    Distance mat[n][n];

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

    for (int i = 0; i < n; i++){
        for (int j = i+1; j < n; j++){
                if(p[i].y - p[j].y == 0)
                    mat[i][j].y == 10000111;
                mat[i][j].y = (double)(p[i].x - p[j].x)/(p[i].y - p[j].y);
                mat[i][j].x = abs(p[i].y - p[j].y)*abs(p[i].y - p[j].y) + abs(p[i].x - p[j].x)*abs(p[i].x - p[j].x);
        }
    }

    /*for (int i = 0; i < n; i++){
        for (int j = 0; j < n; j++){
            cout << mat[i][j].y << " ";
        }
        cout << endl;
    }
    cout << endl;
    for (int i = 0; i < n; i++){
        for (int j = i; j < n; j++){
            cout << mat[i][j].x << " ";
        }
        cout << endl;
    }*/
    for (int i = 0; i < n; i++){
        for (int j = i+1; j < n; j++){
            if(mp.find(mat[i][j].y) == mp.end()){
                set<long long> s;
                s.insert(mat[i][j].x); 
                mp.insert(pair<long long, set<long long> >(mat[i][j].y, s));
            }
            else{
                auto itr = mp.find(mat[i][j].y);
                if((itr->second.find(mat[i][j].x * 4) != itr->second.end()) || (itr->second.find(mat[i][j].x / 4) != itr->second.end())){
                    br++;
                }
                itr->second.insert(mat[i][j].x);
            }
        }
    }
    cout << br;

    return 0;
}