#include using namespace std; template using vec = vector; template using vvec = vector>; int main() { int n; cin >> n; vec> bal(n); for (auto &[x, y]: bal) cin >> x >> y; using dist_t = array; priority_queue, greater> que; for (int i = 0; i < n; ++i) { for (int j = i + 1; j < n; ++j) { int dx = abs(bal[i][0] - bal[j][0]), dy = abs(bal[i][1] - bal[j][1]); que.push({ (max(dx, dy) + 1) / 2 + ((!(dx & 1) && !(dy & 1)) && dx == dy), i, j }); } } int ans = 0; vec used(n, false); while (que.size()) { auto [d, a, b] = que.top(); que.pop(); if (used[a] || used[b]) continue; tie(a, b) = make_tuple(min(a, b), max(a, b)); used[a] = a != 0; used[b] = true; ans += a == 0; } cout << ans << endl; }