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