#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N, K;
  cin >> N >> K;
  vector<int> A(N, 0);
  for (int i = 0; i < (int)(N); i++) {
    cin >> A[i];
  }
  int ans = 0;
  vector<int> B(1, A[0]);
  int index = 1, B_i = B[0];
  while (index <= A.size()) {
    if (abs(A[index] - B_i) <= K) {
      B_i = A[index];
      B.push_back(B_i);
    }
    index++;
  }
  ans = B.size();
  cout << ans << endl;
}
