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