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