#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using u64 = uint_fast64_t;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007;
//constexpr long long MOD = 998244353;
template<class T1, class T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return true;} return false; }
template<class T1, class T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return true;} return false; }
inline int popcount(int x) {return __builtin_popcount(x);}
inline int popcount(long long x) {return __builtin_popcountll(x);}
void print() { cout << "\n"; }
template<class T, class... Args>
void print(const T &x, const Args &... args) {
    cout << x << " ";
    print(args...);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);

    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    
    ll N,E,T; cin >> N >> E >> T;
    assert(N <= 2000);
    //cout << N << " " << E << " " << T << ln;
    vector<ll> x(N+1);
    rep(i,N) cin >> x[i+1];
    //rep(i,N) cout << x[i+1] << " ";
    //cout << ln;

    vector<ll> dp(N+1,1e18);
    dp[0] = 0;
    auto calc=[&](int i, int j) {
        return dp[j]+(x[i]-x[j+1])*2+max(0LL,T-(x[i]-x[j+1])*2);
    };
    vector<int> rev(N+1);
    int cur = 0;
    for (int i = 1; i <= N; i++) {
        //while (cur < i-1 and calc(i,cur) >= calc(i,cur+1)) cur++;
        //dp[i] = calc(i,cur);
        rep(j,i) {
            if (chmin(dp[i],calc(i,j))) rev[i] = j+1;
        }
    }
    // for (int i = 1; i <= N; i++) {
    //     cout << i << " ";
    // }
    // cout << ln;
    // for (int i = 1; i <= N; i++) {
    //     cout << rev[i] << " ";
    // }
    // cout << ln;

    cout << dp[N]+E << ln;
}
