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