#include <bits/stdc++.h>
using namespace std;
int n, d, arr[200], cnt = 2;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n >> d;
  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) {
      cnt++;
    }
    if ((arr[i + 1] - arr[i]) > 2 * d) {
      cnt += 2;
    }
  }
  cout << cnt;
  return 0;
}
