#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int co = 1, jud = 0;
  for (int i = 0; i < n; i = jud) {
    for (int l = jud + 1; l < n; l++) {
      if (abs(a[i] - a[l]) <= k) {
        co++;
        jud = l;
        break;
      }
    }
    if (i + 1 == n) {
      break;
    }
  }
  cout << co << endl;
}
