#include<bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;

#define MOD 1000000007
#define MOD99 998244353
 
int main(){
  int n,k,now,count = 1;
  cin >> n >> k;
  vector<int> a(n),numbers(300002);
  for(int i = 0;i < n;i++){
    cin >> a[i];
  }
  now = a[0];
  for(int i = 1;i < n;i++){
    if(abs(now - a[i]) <= k){
      count++;
      now = a[i];
    }
  }
  cout << count << endl;

}