#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  long long d;
  cin >> n >> d;
  std::vector<long long> arr(n);
  for (long long i = 0; i < n; i++) cin >> arr[i];
  long long count = 1;
  long long pos = arr[0] - d;
  for (long long i = 0; i < n - 1; i++) {
    pos = arr[i] + d;
    if (pos - arr[i] >= d && arr[i + 1] - pos >= d) {
      count++;
    }
    if (arr[i + 1] - d != arr[i] + d) {
      pos = arr[i + 1] - d;
      if (pos - arr[i] >= d && arr[i + 1] - pos >= d) {
        count++;
      }
    }
  }
  count++;
  cout << count << endl;
  return 0;
}
