N, K = map(int, input().split()) H = list(map(int, input().split())) XY = [list(map(int, input().split())) for _ in range(N)] live = [True] * N for i in range(N): for j in range(i+1, N): x1, y1 = XY[i] x2, y2 = XY[j] dist = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 if dist <= K: if H[i] > H[j]: live[j] = False elif H[i] < H[j]: live[i] = False print(sum(live))