#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9 * 2;
int main() {
  int n, k;
  cin >> n >> k;
  int a[n];
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  int last = a[0];
  int out = 1;
  for (int i = 1; i < n; i++) {
    if (abs(last - a[i]) <= k) {
      out++;
      last = a[i];
    }
  }
  cout << out << endl;
}
