#include using namespace std; using ll = long long; template istream& operator >> (istream& is, vector& vec) { for(T& x : vec) is >> x; return is; } int main(){ ios::sync_with_stdio(false); cin.tie(0); ll n, k; cin >> n >> k; vector h(n); vector> a(n); cin >> h; for(auto &&[x, y] : a){ cin >> x >> y; } auto f = [&](int i, int j){ auto [x1, y1] = a[i]; auto [x2, y2] = a[j]; ll dx = x1 - x2, dy = y1 - y2; return dx * dx + dy * dy <= k * k; }; vector used(n); for(int i = 0; i < n; i++){ for(int j = i + 1; j < n; j++){ if(!f(i, j)) continue; if(h[i] > h[j]) used[j] = true; else if(h[i] < h[j]) used[i] = true; } } cout << n - count(used.begin(), used.end(), true) << '\n'; }