#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  vector<int> b;
  int b_index = 0;
  for (int(i) = 0; (i) < (n); (i)++) {
    cin >> a[i];
  }
  b.push_back(a[0]);
  for (int(i) = 0; (i) < (n); (i)++) {
    if (i == 0) {
      continue;
    }
    if (abs(a[i] - b[b_index]) <= k) {
      b.push_back(a[i]);
      b_index++;
    }
  }
  cout << b.size();
}
