#include <bits/stdc++.h>
int main() {
  int n, d, a, b, s = 2;
  int i;
  scanf("%d %d", &n, &d);
  scanf("%d", &a);
  for (i = 1; i < n; i++) {
    scanf("%d", &b);
    if (b - a - 2 * d > 0) s += 2;
    if (b - a - 2 * d == 0) s += 1;
    a = b;
  }
  printf("%d", s);
}
