#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    int n;
    cin>>n;
    pair<int,int> a[n];
    for(int i=0;i<n;++i)
    {
        cin>>a[i].first>>a[i].second;
    }
    map<pair<int,int>,map<ll,int>>mp;
    ll ans=0;
    for(int i=0;i<n;++i)
    {
        for(int j=i+1;j<n;++j)
        {
            int x1,y1,x2,y2;
            x1=a[i].first;
            x2=a[j].first;
            y1=a[i].second;
            y2=a[j].second;
            if(x2<x1)
            {
                swap(x2,x1);
                swap(y2,y1);
            }
            int slope1=x2-x1,slope2=y2-y1;
            int gcd=__gcd(slope1,slope2);
            if(gcd==0)gcd=1;
            pair<int,int>slope=make_pair(slope1/gcd,slope2/gcd);
            ll dist=1ll*slope1*slope1+1ll*slope2*slope2;
            ans=ans+mp[slope][dist*4];
            if(dist%4==0)
                ans=ans+mp[slope][dist/4];
            mp[slope][dist]++;
        }
    }
    cout<<ans<<endl;
    return 0;
}