#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  cin >> n;
  long int d;
  cin >> d;
  long int m;
  m = 2 * d;
  int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  long int cnt = 0;
  for (i = 1; i < n; i++) {
    if ((a[i] - d) > a[i - 1] + d) {
      cnt += 2;
    } else if ((a[i] - d) == a[i - 1] + d) {
      cnt += 1;
    }
  }
  cnt += 2;
  cout << cnt;
}
