#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using ll = long long int;
using P = pair<int, int>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
ll mod = 1000000007;

int cnt = 0;

int main() {
    int n,k;
    cin >> n >> k;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    int j = 0;
    rep1(i,n-1) {
        if(abs(a[i]-a[j]) <= k) {
            cnt++;
            j = i;
        }
    }
    cout << cnt + 1 << endl;
    return 0;
}
