#include <bits/stdc++.h>
using namespace std;
int tab[1000000];
bool porownaj(int a, int b) { return a > b; }
int main() {
  int a, b, ile = 1;
  cin >> a >> b;
  for (int i = 0; i < a; i++) {
    cin >> tab[i];
  }
  if (a == 1) {
    cout << 1 << endl;
    exit(0);
  }
  sort(tab, tab + a, porownaj);
  for (int i = 0; i < a - 1; i++) {
    if (tab[i] - tab[i + 1] > b) {
      cout << ile << endl;
      exit(0);
    }
    ile++;
  }
  cout << ile << endl;
}
