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