#include <bits/stdc++.h>
using namespace std;
long long n, k;
long long ans = 0;
void func(vector<long long> a, long long l) {
  if (l <= ans) return;
  for (long long i = (0); i < (l - 1); ++i) {
    long long tmp = a[i] - a[i + 1];
    if (tmp < 0) tmp *= -1;
    if (tmp > k) {
      vector<long long> b, c;
      b = c = a;
      l--;
      b.erase(b.begin() + i);
      c.erase(c.begin() + i + 1);
      func(b, l);
      func(c, l);
      return;
    }
  }
  ans = l;
}
signed main(void) {
  cin >> n >> k;
  vector<long long> a;
  long long tmp;
  for (long long i = (0); i < (n); ++i) {
    cin >> tmp;
    a.insert(a.end(), tmp);
  }
  func(a, n);
  cout << ans << endl;
}
