#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long t, a, b, c, d = 0, n, m, k = 0, sum = 0, i, j;
  sum = 0, k = 0;
  bool ok = true;
  cin >> n >> m;
  vector<long long> v(n + 1), vec;
  for (i = 1; i <= n; i++) {
    cin >> v.at(i);
  }
  for (i = 1; i < n; i = j) {
    for (j = i + 1; j <= n; j++) {
      if (abs(v[i] - v[j]) <= m) {
        vec.push_back(v[i]);
        c = v[j];
        break;
      }
    }
  }
  vec.push_back(c);
  cout << vec.size() << endl;
  return 0;
}
