#include <bits/stdc++.h>
using namespace std;
int ar[2000007];
int main() {
  int n, k, sum = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> ar[i];
  for (int i = 1; i < n; i++) {
    int ans = ar[i] - ar[i - 1];
    if (ans < (2 * k)) continue;
    if (ans == (2 * k))
      sum++;
    else
      sum = sum + 2;
  }
  sum = sum + 2;
  cout << sum << endl;
  return 0;
}
