#include using namespace std; map, vector>> mp; int main() { int n; cin >> n; vector x(n); vector y(n); for (int i = 0; i < n; i++) { cin >> x[i] >> y[i]; } int ans = 0; for (int i = 0; i < n; i++) { for (int j = i+1; j < n; j++) { long long tx = x[i]-x[j]; long long ty = y[i]-y[j]; long long nx = x[i]+x[j]; long long ny = y[i]+y[j]; if (mp.find({nx, ny}) != mp.end()) { for (auto [x, y]: mp[{nx, ny}]) { if (tx*x + ty*y == 0) ans++; } } mp[{nx, ny}].push_back({tx, ty}); } } cout << ans << endl; }