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