#include using namespace std; using ll=long long; using pll=pair; using tll=tuple; using ld=long double; const ll INF=(1ll<<60); #define rep(i,n) for (ll i=0;i<(ll)(n);i++) #define all(v) v.begin(),v.end() template inline bool chmin(T &a,T b){ if(a>b){ a=b; return true; } return false; } template inline bool chmax(T &a,T b){ if(a> mp; ll n; cin >> n; rep(i,n) cin >> x[i] >> y[i]; rep(i,n){ rep(j,i){ mp[{x[i]+x[j],y[i]+y[j]}].emplace_back(x[j]-x[i],y[j]-y[i]); } } ll ans=0; for(auto [k,v]:mp){ map cnt; for(auto p:v) cnt[p]++; for(auto [p,c]:cnt){ for(auto [q,d]:cnt){ auto [ax,ay]=p; auto [bx,by]=q; if(ax*bx+ay*by==0) ans+=c*d; } } } ans/=2; cout << ans << '\n'; }