#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;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

ll dp[2001];

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    ll n,e,t;
    cin>>n>>e>>t;
    vector<ll> v;
    v.pb(0);
    for(ll i=0;i<n;i++){
        ll k;
        cin>>k;
        v.pb(k);
    }
    for(ll i=1;i<=n;i++){
        dp[i]=9999999999999999;
    }
    dp[0]=0;
    for(ll i=1;i<=n;i++){
        for(ll j=0;j<i;j++){
            ll u=3*(v[i]-v[j+1]);

            if(u/3*2<t)
                u+=(t-u/3*2);

            dp[i]=min(v[j+1]-v[j]+dp[j]+u,dp[i]);

        }
    }
    if(e>v[n])
        dp[n]+=e-v[n];
    else
        dp[n]+=v[n]-e;
    cout<<dp[n];
}
