#include <bits/stdc++.h>
int main(void) {
  int n, d;
  int min = -1000000000, max = 1000000000;
  int ans = 0;
  scanf("%d%d", &n, &d);
  int i;
  int a, b;
  scanf("%d", &a);
  n--;
  ans++;
  for (i = 0; i < n; i++) {
    scanf("%d", &b);
    if (((b - a) / d) >= 2)
      ans = (((b - a) % d) || ((b - a) / d) > 2) ? ans + 2 : ans + 1;
    a = b;
  }
  ans++;
  printf("%d\n", ans);
  return 0;
}
