#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K;
  cin >> N >> K;
  vector<int> aa(N, 0), ab;
  int b = -1;
  for (auto &i : aa) {
    cin >> i;
    if (b < 0 || abs(i - b) <= K) {
      ab.push_back(i);
      b = i;
    }
  }
  cout << ab.size() << endl;
  return 0;
}
