#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    pair<long long,long long>t[1510];
    map<pair<long long,long long>,long long>s;
    for (int i=0; i<n; i++)
    {
        int a,b;
        cin >> a >> b;
        t[i]=make_pair(a,b);
    }
    long long br=0;
    for (int i=0; i<n; i++)
        for (int j=i+1; j<n; j++)
            s[make_pair(t[i].first-t[j].first,t[i].second-t[j].second)]++;
    for (int i=0; i<n; i++)
        for (int j=i+1; j<n; j++)
        {
            br+=s[make_pair(2*(t[i].first-t[j].first),2*(t[i].second-t[j].second))];
            br+=s[make_pair(-2*(t[i].first-t[j].first),-2*(t[i].second-t[j].second))];
        }
    cout << br;
    return 0;
}