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