#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N, K, X, Y, count;
  count = 1;
  cin >> N >> K;
  vector<long long> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  X = A[0] + K;
  Y = A[0] - K;
  for (int i = 1; i <= N; i++) {
    if (Y <= A[i] && A[i] <= X) {
      X = A[i] + K;
      Y = A[i] - K;
      count++;
    }
  }
  cout << count << endl;
}
