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