N,K = map(int,input().split()) H = list(map(int,input().split())) XY = [tuple(map(int,input().split())) for _ in range(N)] order = list(range(N)) order.sort(key=lambda i: H[i]) deleted = [0] * N for i in range(1,N): oi = order[i] x,y = XY[oi] for j in range(i): oj = order[j] if deleted[oj]: continue if H[oi] == H[oj]: continue x2,y2 = XY[oj] if (x-x2)**2 + (y-y2)**2 <= K**2: deleted[oj] = 1 print(N - sum(deleted))