#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int N, a[100], D;
  cin >> N >> D;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  sort(a, a + N);
  int count = 2;
  for (int i = 1; i < N; ++i) {
    int d = a[i] - a[i - 1];
    if (d > 2 * D)
      count += 2;
    else if (d == 2 * D)
      count++;
  }
  cout << count << endl;
}
