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

#define sz(x) ((int)(x).size())
#define pb push_back
#define vec vector
#define fi first
#define se second
#define ends "\n"
#define sp ' '
#define fun function
#define ar(x) array<int, x>
#define rall(x) (x).rbegin(), (x).rend()
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pii;

const long long MOD=1e9+7; 

void DBG() { cerr << "]" << endl; }
template<class H, class... T> void DBG(H h, T... t) { cerr << to_string(h); if(sizeof...(t)) cerr << ", "; DBG(t...); }
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)

class P{
    public:

    double x, y;

    void read(){
        cin >> x >> y;
    }

    void print(){
        cout << x << sp << y << ends;
    }
};

int main(void){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr); cerr.tie(nullptr);
 	
    int n;
    cin >> n;

 	vec<P> a(n);
    for(int i = 0; i < n; ++i)
        a[i].read();


    map<double, map<double, int>> mp;
    map<double, int> specCase;

    fun<double(double)> sq = [&] (double x){
        return x * x;
    };

    fun<double(P, P)> dist = [&] (P p1, P p2){
        return sq(p1.x - p2.x) + sq(p1.y - p2.y);
    };

    fun<void(P, P)> fndK = [&] (P p1, P p2){
        double d = dist(p1, p2);
        if(p1.x == p2.x)
            specCase[d]++;
        else{
            double k = (p1.y - p2.y) / (p1.x - p2.x);
            (mp[k])[d]++;
        }
    };

    for(int i = 0; i < n - 1; ++i){
        for(int j = i + 1; j < n; ++j){
            fndK(a[i], a[j]);
        }
    }

    int ans = 0;

    for(auto K : mp){
        for(auto D : K.se){
            ans += D.se * ((K.se)[D.fi * 4.0]);
        }
    }

    // dbg(ans);

    for(auto D : specCase){
        ans += D.se * specCase[D.fi * 4.0];
    }

    cout << ans << ends;

}