#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long i, j, k, m = 0, n, x, y, s = 0, z = 2, d;
  cin >> n >> d;
  long long a[n + 7];
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    if (i > 1) {
      if (a[i] - a[i - 1] == 2 * d)
        z++;
      else if (a[i] - a[i - 1] > 2 * d)
        z += 2;
    }
  }
  cout << z;
  return 0;
}
