#include <bits/stdc++.h>

#define pb push_back
#define ll long long
#define pii pair<int, int>
#define xx first
#define yy second
#define MAXN 1510

using namespace std;

int n;
ll ress;
pii a[MAXN];
map< pair<pii, int>, ll > kolko;

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

    //cout<<__gcd(0, 10)<<" "<<__gcd(120, 0)<<endl;
    cin>>n;
    for (int i=0; i<n; i++) cin>>a[i].xx>>a[i].yy;

    sort(a, a+n);

    for (int i=0; i<n; i++)
    {
        for (int j=i+1; j<n; j++)
        {
            int deltax, deltay;
            deltax=a[j].xx-a[i].xx;
            deltay=a[j].yy-a[i].yy;

            int stari=deltax, stari2=deltay;

            int nzd=__gcd(deltax, abs(deltay));
            deltax/=nzd; deltay/=nzd;

            ///cout<<i<<" "<<j<<": "<<deltax<<" "<<deltay<<" "<<stari<<" "<<stari2<<endl;

            if (deltax==0)
            {
                if (stari2%2==0) { ress+=kolko[{{deltax, deltay}, stari2/2}]; }
                ress+=kolko[{{deltax, deltay}, stari2*2}];

                kolko[{{deltax, deltay}, stari2}]++;
            }
            else
            {
                if (stari%2==0) { ress+=kolko[{{deltax, deltay}, stari/2}]; }
                ress+=kolko[{{deltax, deltay}, stari*2}];
                kolko[{{deltax, deltay}, stari}]++;
            }
            ///cout<<ress<<endl;
        }
    }

    cout<<ress;

}