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