#include <cstdio>
#include <vector>
#include <algorithm>
#include <array>
#include <set>
#include <map>
#include <queue>
#include <tuple>
#include <unordered_set>
#include <unordered_map>
#include <functional>
#include <cassert>
#define repeat(i, n) for (int i = 0; (i) < int(n); ++(i))
#define repeat_from(i, m, n) for (int i = (m); (i) < int(n); ++(i))
#define repeat_reverse(i, n) for (int i = (n)-1; (i) >= 0; --(i))
#define repeat_from_reverse(i, m, n) for (int i = (n)-1; (i) >= int(m); --(i))
#define whole(x) begin(x), end(x)
#define unittest_name_helper(counter) unittest_ ## counter
#define unittest_name(counter) unittest_name_helper(counter)
#define unittest __attribute__((constructor)) void unittest_name(__COUNTER__) ()
using ll = long long;
using namespace std;
template <class T> inline void setmax(T & a, T const & b) { a = max(a, b); }
template <class T> inline void setmin(T & a, T const & b) { a = min(a, b); }
template <typename X, typename T> auto vectors(X x, T a) { return vector<T>(x, a); }
template <typename X, typename Y, typename Z, typename... Zs> auto vectors(X x, Y y, Z z, Zs... zs) { auto cont = vectors(y, z, zs...); return vector<decltype(cont)>(x, cont); }

constexpr ll inf = ll(1e18)+9;
int main() {
    // input
    int n, e, t; scanf("%d%d%d", &n, &e, &t);
    vector<int> x(n); repeat (i, n) scanf("%d", &x[i]);
    x.push_back(e);
    vector<ll> dp(n + 1, inf);
    dp[n] = 0;
    repeat_reverse (l, n) {
        repeat_from (r, l + 1, n + 1) {
            setmin(dp[l], max<ll>(t, 2ll * (x[r - 1] - x[l])) + (x[r] - x[l]) + dp[r]);
        }
    }
    // output
    printf("%lld\n", x[0] + dp[0]);
    return 0;
}
