#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, d;
  cin >> n >> d;
  long long int ar[n];
  long long int ans = 0;
  for (long long int i = 0; i < n; ++i) {
    cin >> ar[i];
  }
  ans = 1;
  for (long long int i = 1; i < n; ++i) {
    long long int ch = ar[i] - ar[i - 1];
    if (ch == 2 * d) {
      ++ans;
    } else if (ch > 2 * d) {
      ans += 2;
    }
  }
  ++ans;
  cout << ans;
  return (0);
}
