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