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