#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 77;
long long A[N], dp[N];
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k;
  cin >> n >> k;
  for (long long i = 0; i < n; ++i) {
    cin >> A[i];
  }
  dp[0] = 1;
  long long mx, idx;
  for (long long t = 1; t <= 1000; ++t) {
    mx = 1, idx = 0;
    for (long long i = 1; i < n; ++i) {
      long long x = abs(A[idx] - A[i]);
      if (x <= k) {
        mx++;
        idx = i;
      }
    }
  }
  cout << mx << '\n';
  return 0;
}
