#include<bits/stdc++.h>
#define ll long long
#define ld long double 
#define pb push_back
#define mp make_pair
#define F first
#define S second

using namespace :: std;


const ll  maxn=1e5+500;
const ll inf=2e18+7;

ll dp[maxn];
ll a[maxn];
ll parminn[maxn];
int main(){
    fill(dp,dp+maxn,inf);
    ll n,e,t;
    cin>>n>>e>>t;
    t*=2;
    e*=2;
    for(ll i=1;i<=n;i++){
        cin>>a[i];
        a[i]*=2;
    }
    ll p=0;
    dp[0]=0;
    for(ll i=1;i<=n;i++){
        while(p+1<i && a[i]-a[p+1]>=t/2){
            p++;
        }
        if(p==0){
            dp[i]=t;
        }else{
            dp[i]=min(dp[p]+t,parminn[p]+a[i]*2);
        }
        parminn[i]=min(parminn[i-1],dp[i-1]-a[i]*2);
    }
    cout<<(dp[n]+e)/2;
}