#include <bits/stdc++.h>
using namespace std;
namespace std {
template <typename T, typename U>
struct hash<pair<T, U>> {
  hash<T> t;
  hash<U> u;
  size_t operator()(const pair<T, U>& p) const {
    return t(p.first) ^ (u(p.second) << 7);
  }
};
}  // namespace std
template <typename T, typename F>
T bsh(T l, T h, const F& f) {
  T r = -1, m;
  while (l <= h) {
    m = (l + h) / 2;
    if (f(m)) {
      l = m + 1;
      r = m;
    } else {
      h = m - 1;
    }
  }
  return r;
}
template <typename T, typename F>
T bsl(T l, T h, const F& f) {
  T r = -1, m;
  while (l <= h) {
    m = (l + h) / 2;
    if (f(m)) {
      h = m - 1;
      r = m;
    } else {
      l = m + 1;
    }
  }
  return r;
}
template <typename T>
T gcd(T a, T b) {
  if (a < b) swap(a, b);
  return b ? gcd(b, a % b) : a;
}
int main(int, char**) {
  ios_base::sync_with_stdio(false);
  long long N, E, T;
  cin >> N >> E >> T;
  if (N > 2000) return 0;
  vector<long long> X(N);
  for (auto& _cinv : X) cin >> _cinv;
  ;
  vector<long long> H(N, 0);
  for (int i = 0; i < N; i++) {
    H[i] = X[i] + max(T, 2 * X[i] - 2 * X[0]);
    for (int j = 0; j < i; j++) {
      H[i] = min(H[i], H[j] + X[i] - X[j] + max(T, 2 * X[i] - 2 * X[j + 1]));
    }
  }
  cout << H[N - 1] + E - X[N - 1] << endl;
}
