#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n, c1 = 0, c2 = 0;
  cin >> t >> n;
  vector<long long> v(t);
  for (int i = 0; i < t; i++) {
    cin >> v[i];
  }
  if (t == 1) {
    cout << "2";
  } else {
    for (int i = 0; i < t - 1; i++) {
      if (v[i + 1] - v[i] < 2 * n) {
        c1++;
      } else if (v[i + 1] - v[i] == 2 * n) {
        c2++;
      }
    }
    cout << 2 * t - 2 * c1 - c2;
  }
}
