using System; using System.Collections.Generic; namespace Ichiendama { class Ichiendama { public static int Radius = 10; private int _x; private int _y; public int X { get { return _x; } } public int Y { get { return _y; } } public Ichiendama(int x, int y) { _x = x; _y = y; } // 2乗距離を返す public static double Distance2(Ichiendama a, Ichiendama b) { return (Math.Pow(a.X - b.X, 2.0) + Math.Pow(a.Y - b.Y, 2.0)); } // 重なっていればtrueを返す public static bool CheckOverlap(Ichiendama a, Ichiendama b) { if (Ichiendama.Distance2(a, b) < Math.Pow(Ichiendama.Radius * 2, 2.0)) { return true; } else { return false; } } } class Program { static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); int M = 2001; int ans = 0; List[,] Valids = new List[M, M]; for (int i = 0; i < M; i++) { for (int j = 0; j < M; j++) { Valids[i, j] = new List(); } } char[] delimiter = { ' ' }; for (int i = 0; i < N; i++) { string[] s = Console.ReadLine().Split(delimiter); int[] xy = { int.Parse(s[0]), int.Parse(s[1]) }; Ichiendama newcoin = new Ichiendama(xy[0], xy[1]); bool isOverlap = false; int nx = xy[0]/10; int ny = xy[1]/10; for (int dx = Math.Max(nx - 2, 0); dx <= Math.Min(nx + 2, M-1); dx++) { for (int dy = Math.Max(ny - 2, 0); dy <= Math.Min(ny + 2, M-1); dy++) { foreach (Ichiendama v in Valids[dx, dy]) { if (Ichiendama.CheckOverlap(v, newcoin)) { isOverlap = true; break; } } } } if (isOverlap == false) { Valids[nx, ny].Add(newcoin); ans++; } } Console.WriteLine(ans); } } }