from collections import defaultdict N, K = map(int, input().split()) assert 1 <= N <= 2000 assert 1 <= K <= 10**9 H = list(map(int, input().split())) assert all(1 <= h <= 10**9 for h in H) points = defaultdict(list) for i in range(N): X, Y = map(int, input().split()) assert 1 <= X <= 10**9 assert 1 <= Y <= 10**9 points[H[i]].append((X, Y)) # 末尾に不要な入力がないかチェック try: input() exit(1) except EOFError: pass existing = [] for h in sorted(points.keys()): reject = set() for X, Y in points[h]: for i, (x, y) in enumerate(existing): if (X - x)**2 + (Y - y)**2 <= K**2: reject.add(i) new_existing = [] for i, (X, Y) in enumerate(existing): if i not in reject: new_existing.append((X, Y)) for X, Y in points[h]: new_existing.append((X, Y)) existing = new_existing print(len(existing))