import std.algorithm, std.array, std.container, std.range, std.bitmanip; import std.numeric, std.math, std.bigint, std.random, core.bitop; import std.string, std.regex, std.conv, std.stdio, std.typecons; auto maxX = 20000, maxY = 20000; void main() { auto n = readln.chomp.to!size_t; auto pi = iota(n) .map!(_ => readln.split.map!(to!int)) .map!(rd => point(rd[0], rd[1])).array; auto xb = new int[][](maxX + 1); auto yb = new int[][](maxY + 1); auto r = 0; loop: foreach (int i, p; pi) { auto xi = max(p.x - 10, 0), xa = min(p.x + 10, maxX); auto yi = max(p.y - 10, 0), ya = min(p.y + 10, maxY); int[] xc, yc; foreach (x; xi..xa+1) xc ~= xb[x]; foreach (y; yi..ya+1) yc ~= yb[y]; foreach (c; setIntersection(xc.sort().uniq(), yc.sort().uniq())) if ((p - pi[c]).hypot2 < 400) continue loop; xb[xi] ~= i; xb[xa] ~= i; yb[yi] ~= i; yb[ya] ~= i; ++r; } writeln(r); } struct Point(T) { T x, y; point opBinary(string op)(point rhs) { static if (op == "+") return point(x + rhs.x, y + rhs.y); else static if (op == "-") return point(x - rhs.x, y - rhs.y); } int hypot2() { return x ^^ 2 + y ^^ 2; } } alias Point!int point;