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