#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  int i = 0, j = 1, c = 0;
  while (j < n) {
    if (abs(v[i] - v[j]) <= k) {
      c++;
      i = j;
      j++;
    } else
      j++;
  }
  cout << c + 1 << "\n";
}
