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