#include using namespace std; using ll = long long int; int main() { int n; cin >> n; vector x(n), y(n); for (int i = 0; i < n; i++) cin >> x[i] >> y[i]; vector> v; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { ll d = (x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]); v.push_back({d, i, j}); } } sort(begin(v), end(v)); vector used(n, false); int cnt = 0; for (auto [d, i, j] : v) { if (used[i] or used[j]) continue; if (i == 0) used[j] = true, cnt++; else if (j == 0) used[i] = true, cnt++; else used[i] = used[j] = true; } cout << cnt << "\n"; }