#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1;
int a[N], b[N];
int main() {
  int n, t, x, y, d;
  long long ans = 2;
  cin >> n >> d;
  cin >> a[0];
  for (int i = 1; i < n; i++) {
    cin >> a[i];
    if (abs(a[i] - a[i - 1]) == 2 * d)
      ans++;
    else if (a[i] - a[i - 1] > 2 * d)
      ans += 2;
  }
  cout << ans << endl;
  return 0;
}
