#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
int main() {
  int n, k;
  cin >> n >> k;
  std::vector<int> a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (abs(a[i] - a[j]) <= k) {
        cnt++;
        i = j - 1;
        break;
      }
    }
  }
  if (cnt == 0)
    cout << cnt << endl;
  else
    cout << cnt + 1 << endl;
}
