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