import java.io.*; import java.util.*; import java.util.function.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int k = sc.nextInt(); House[] houses = new House[n]; for (int i = 0; i < n; i++) { houses[i] = new House(sc.nextInt()); } for (int i = 0; i < n; i++) { houses[i].point = new Point(sc.nextInt(), sc.nextInt()); } Arrays.sort(houses); long d2 = (long)k * k; int ans = 0; for (int i = 0; i < n; i++) { boolean enable = false; for (int j = i + 1; j < n && !enable; j++) { enable = houses[i].histry < houses[j].histry && houses[i].getDistance2(houses[j]) <= d2; } if (!enable) { ans++; } } System.out.println(ans); } static class House implements Comparable { int histry; Point point; public House(int histry) { this.histry = histry; } public long getDistance2(House h) { return point.getDistance2(h.point); } public int compareTo(House another) { return histry - another.histry; } } static class Point { long x; long y; public Point(long x, long y) { this.x = x; this.y = y; } public long getDistance2(Point p) { return (x - p.x) * (x - p.x) + (y - p.y) * (y - p.y); } } } class Scanner { BufferedReader br; StringTokenizer st = new StringTokenizer(""); public Scanner() { try { br = new BufferedReader(new InputStreamReader(System.in)); } catch (Exception e) { } } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String next() { try { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } } catch (Exception e) { e.printStackTrace(); } finally { return st.nextToken(); } } }