#include <bits/stdc++.h>
using namespace std;
long long int d, a[110];
int n, ans = 2;
int main() {
  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) ans++;
    if (a[i + 1] - a[i] > 2 * d) ans += 2;
  }
  cout << ans;
  return 0;
}
