#include <bits/stdc++.h>
int main() {
  int n, t, e;
  scanf("%d%d%d", &n, &e, &t);
  std::vector<int> v(n);
  std::vector<char> used(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &v[i]);
    used[i] = 0;
  }
  long long tt = v[0];
  for (int i = 0; i < n - 1; i++) {
    if (used[i]) {
      tt += v[i + 1] - v[i];
    } else {
      int cur = v[i] + t;
      int j = std::lower_bound(v.begin() + i, v.end(), cur) - (v.begin() + i);
      if (j == v.size()) j--;
      for (int ii = i; ii <= j; ii++) used[ii] = true;
      tt += std::max(t, (v[j] - v[i]) * 2);
      tt += v[i + 1] - v[i];
    }
  }
  if (used[n - 1] == false) {
    tt += t;
  }
  tt += e - v[n - 1];
  std::cout << tt << std::endl;
}
