#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, K, kotae;
  cin >> N >> K;
  vector<int> retu(N);
  for (long long i = 0; i < N; i++) {
    long long A;
    cin >> A;
    retu.at(i) = A;
  }
  for (long long i = 1; i < N; i++) {
    if (retu.at(i - 1) - retu.at(i) <= K) {
      kotae++;
    } else {
      if (retu.at(i) - retu.at(i - 1) <= K) {
        kotae++;
      }
    }
  }
  cout << kotae << endl;
}
