#include <bits/stdc++.h>
using namespace std;
const int N = 1000 + 5;
int a[N];
int cnt = 2;
int n, d;
int main() {
  cin >> n >> d;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = 1; i < n; i++) {
    if (a[i] - a[i - 1] >= 2 * d) cnt++;
    if (a[i] - a[i - 1] > 2 * d) cnt++;
  }
  cout << cnt << endl;
}
