import std.stdio, std.array, std.string, std.conv, std.algorithm; import std.typecons, std.range, std.random, std.math, std.container; import std.numeric, std.bigint, core.bitop, core.stdc.stdlib, std.datetime; void main() { auto N = readln.chomp.to!int; auto A = iota(N).map!(_ => readln.split.map!(to!long).array).array; long dist(int i, int j) { return (A[i][0] - A[j][0]) ^^ 2 + (A[i][1] - A[j][1]) ^^ 2; } auto pq = new BinaryHeap!(Array!(Tuple!(int, int, long)), "a[2] > b[2]"); foreach (i; 0..N) foreach (j; i+1..N) pq.insert(tuple(i, j, dist(i, j))); auto used = new bool[](N); int ans = 0; while (!pq.empty) { auto i = pq.front[0]; auto j = pq.front[1]; pq.removeFront; if (used[i] || used[j]) { continue; } if (i == 0) { ans += 1; used[j] = true; } else { used[i] = used[j] = true; } } ans.writeln; }