#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll=long long; template using V = vector; template using P = pair; using vll = V; using vvll = V; #define ALL(v) v.begin(),v.end() template < class T > inline bool chmax(T& a, T b) {if (a < b) { a=b; return true; } return false; } template < class T > inline bool chmin(T& a, T b) {if (a > b) { a=b; return true; } return false; } #define DEBUG_VLL(vec) REP(sz, vec.size()) std::cerr<; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; V xy(n); for (int i = 0; i < n; i++) cin >> xy[i].first >> xy[i].second; V< P > time; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { double t = (xy[i].first - xy[j].first) * (xy[i].first - xy[j].first) + (xy[i].second - xy[j].second) * (xy[i].second - xy[j].second); time.emplace_back(t, PI(i, j)); } } sort(ALL(time)); V broken(n, false); int ans = 0; ll tmp = 0, se0 = 0; set bl; for (P ttt: time) { if (ttt.first != tmp) { ans += se0; se0 = 0; for (int b: bl) broken[b] = true; bl.clear(); } if (ttt.second.first == 0) { if (broken[ttt.second.second]) continue; else se0++, broken[ttt.second.second] = true; } else if (ttt.second.second == 0) { if (broken[ttt.second.first]) continue; else se0++, broken[ttt.second.second] = true; } else { if (!broken[ttt.second.first] and !broken[ttt.second.second]) { bl.insert(ttt.second.first), bl.insert(ttt.second.second); } } tmp = ttt.first; } ans += se0; cout << ans << '\n'; return 0; }