#include <bits/stdc++.h>
using namespace std;
int a[100005];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 0; i <= n - 1; i++) {
    scanf("%d", &a[i]);
  }
  int count = 1, now = a[0];
  for (int i = 1; i <= n - 1; i++) {
    if (abs(a[i] - now) <= k) {
      count++;
      now = a[i];
    }
  }
  printf("%d\n", count);
  return 0;
}
