#include<iostream>
#include<string>
using namespace std;
int main()
{
  int k,n;
  cin>>n>>k;
  int a[n];
  for(int i=0;i<n;i++)
  {
    cin>>a[i];
  }
  vector<int> b;
  for(int i=0;i<a.size();i++)
  {
    if(abs(a[i]-a[i+1])<=k) b.push_back(a[i]);
    else {b.push_back(a[i]);i++;}
  }
  //int an[b.size()];
  cout<<b.size()<<endl;
}