#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j = 0, N, K, res = 1;
  cin >> N;
  cin >> K;
  vector<int> data(N);
  for (i = 0; i < N; i++) cin >> data.at(i);
  for (i = 0; i < N - 1; i++) {
    j = i;
    while (1) {
      j++;
      if (abs(data[i] - data[j]) <= K) {
        res++;
        break;
      } else if (abs(data[i] - data[j + 1]) <= K) {
        res++;
        j++;
        break;
      }
    }
    i = j - 1;
  }
  cout << res << endl;
  return 0;
}
