#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const long long MOD = 1000000007;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long seed;
  asm("rdtsc" : "=A"(seed));
  srand(seed);
  long long n, d;
  cin >> n >> d;
  vector<long long> a(n);
  for (auto &x : a) cin >> x;
  long long ans = 2;
  for (long long i = 1; i < n; i++) {
    if (a[i - 1] + d == a[i] - d)
      ans++;
    else if (a[i - 1] + d < a[i] - d)
      ans += 2;
  }
  cout << ans << '\n';
}
