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