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