#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105;
const int INF = 0x3f3f3f3f;
int n, d, a[MAXN], ans;
int main() {
  scanf("%d%d", &n, &d);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    if (i - 1 >= 1 && a[i] - d > a[i - 1] + d) ans++;
    if (i + 1 <= n && a[i] + d <= a[i + 1] - d) ans++;
  }
  printf("%d\n", ans + 2);
  return 0;
}
