#include using namespace std; using ll = long long; const int INF = 1e9 + 10; const ll INFL = 4e18; int main() { int N; cin >> N; vector> XY(N); for (int i = 0; i < N; i++) { cin >> XY[i].first >> XY[i].second; } map>> mp; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { ll dx = XY[j].first - XY[i].first; ll dy = XY[j].second - XY[i].second; ll d = dx * dx + dy * dy; if (mp.count(d) == 0) { mp[d].resize(N); } mp[d][i].push_back(j); mp[d][j].push_back(i); } } ll ans = 0; for (auto [k, G] : mp) { for (int i = 0; i < N; i++) { if (G[i].size() < 2) continue; queue> Q; Q.push({i, 0, -1}); while (!Q.empty()) { auto [now, c, pre] = Q.front(); Q.pop(); for (auto nxt : G[now]) { if (nxt == pre) continue; if (c == 3) { if (nxt == i) ans++; continue; } Q.push({nxt, c + 1, now}); } } } } cout << ans / 8 << endl; }