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