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