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 = 2000, maxY = 2000; 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 buf = new int[][][](maxY + 1, maxX + 1); auto r = 0; loop: foreach (int i, p; pi) { auto x = p.x / 10, y = p.y / 10; auto xi = max(x - 1, 0), xa = min(x + 1, maxX); auto yi = max(y - 1, 0), ya = min(y + 1, maxY); int[] pc; foreach (yc; yi..ya+1) foreach (xc; xi..xa+1) pc ~= buf[yc][xc]; foreach (c; pc) if ((p - pi[c]).hypot2 < 400) continue loop; foreach (yc; yi..ya+1) foreach (xc; xi..xa+1) buf[yc][xc] ~= 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;