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