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