#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  long long a[105];
  scanf("%I64d%I64d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &a[i]);
  }
  if (n == 1) {
    printf("2\n");
  } else {
    long long sum = 2;
    if (a[0] + 2 * k <= a[1]) sum++;
    for (int i = 1; i < n; i++) {
      if (a[i] - 2 * k >= a[i - 1] && a[i - 1] + k != a[i] - k) {
        sum++;
      }
      if (a[i] + 2 * k <= a[i + 1] && i != n - 1) {
        sum++;
      }
    }
    printf("%I64d\n", sum);
  }
  return 0;
}
