#include <bits/stdc++.h>
int main() {
  int n, d, i, j;
  int x[105];
  scanf("%d%d", &n, &d);
  for (i = 1; i <= n; i++) {
    scanf("%d", &x[i]);
  }
  int cnt = 2;
  for (i = 2; i <= n; i++) {
    if (x[i] - x[i - 1] > 2 * d)
      cnt += 2;
    else if ((x[i] - x[i - 1] == 2 * d))
      cnt++;
  }
  printf("%d\n", cnt);
}
