#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18 + 1;
const long long MOD = 1e9 + 7;
const long double PI = 3.14159265358979323846264338;
long long fast_ex(long long a, long long n, long long m) {
  if (n == 0) return 1;
  if (n == 1) return a;
  long long x = 1;
  x *= fast_ex(a, n / 2, m);
  x %= m;
  x *= x;
  x %= m;
  if (n % 2) x *= a;
  x %= m;
  return x;
}
long long n;
long long d;
long long a[101];
void solve() {
  cin >> n >> d;
  long long ans = 2;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < n - 1; i++) {
    long long one = a[i] + d;
    long long two = a[i + 1] - d;
    if (two > one) ans += 2;
    if (two == one) ans++;
  }
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) solve();
  return 0;
}
