#include <bits/stdc++.h>

#include <atcoder/all>

#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;

using namespace std;
using namespace atcoder;

int main() {
    int n, k;
    cin >> n >> k;
    int a[n];
    rep(i, n) cin >> a[i];

    int t = a[0], ans = 0;
    rep(i, n) {
        if (abs(t - a[i]) <= k) ans++, t = a[i];
    }

    cout << ans << endl;
    return 0;
}
