#include <bits/stdc++.h>
long long a[101];
int main() {
  long long n, d;
  std::cin >> n >> d;
  for (long long i = 1; i <= n; i++) std::cin >> a[i];
  long long gg = 2;
  for (long long i = 2; i <= n; i++) {
    long long k = a[i] - a[i - 1];
    if (k == 2 * d)
      gg++;
    else if (k > 2 * d)
      gg += 2;
  }
  std::cout << gg << std::endl;
}
