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