#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000")
#pragma Gcc optimize("O3")
#pragma Gcc target("sse,sse2,sse3,ssse3,sse4,popc2nt,abm,mmx,avx,tune=native")
#pragma Gcc optimize("unroll-loops")
using namespace std;
int mas[64], st2[64];
map<vector<long long>, pair<vector<pair<int, int>>, int>> map1;
map<vector<long long>, long long> map2;
long long s2[1000], ars[1000];
set<long long> set1;
vector<long long> dec2, dec;
long long hech(string s) {
  long long base = 5757, ar = 0, p = 1e9 + 7;
  for (int i = 0; i < s.size(); i++) {
    ar *= base;
    ar += s[i];
    ar = ar % p;
  }
  return ar;
}
int main() {
  int a, b, c, d = 0, z = 0, MAX = 0, MIN, res = 0, x, ans = 0;
  double ans57 = 2, sum;
  char A, B;
  deque<int> de;
  string s;
  cin >> a >> c;
  for (int i = 0; i < a; i++) {
    cin >> b;
    s2[i] = b;
  }
  sort(s2, s2 + a);
  for (int i = 0; i < a - 1; i++) {
    if (s2[i + 1] - s2[i] > 2 * c) {
      ans57 += 2;
    } else if (s2[i + 1] - s2[i] == 2 * c) {
      ans57++;
    }
  }
  cout << ans57;
  cin >> a;
  return 0;
}
