#include <bits/stdc++.h>
int main() {
  int n, d;
  while (scanf("%d %d", &n, &d) != EOF) {
    int s[n], sum = 1;
    for (int i = 0; i < n; i++) scanf("%d", &s[i]);
    for (int i = 0; i < n - 1; i++) {
      if (i != 0) {
        if (s[i] - d > s[i - 1] + d) sum++;
      }
      if (s[i] + d <= s[i + 1] - d) sum++;
    }
    if (s[n - 1] - d > s[n - 2] + d) sum++;
    sum++;
    printf("%d\n", sum);
  }
  return 0;
}
