#include<bits/stdc++.h>
using namespace std;

using ll=long long;
const ll INF=1e18;
int main(){
    int n;
    cin>>n;
    ll t,e;
    cin>>e>>t;
    vector<ll> x(n+1);
    for(int i=1;i<=n;i++) cin>>x[i];

    vector<ll> dp(n+1);    
    multiset<ll> As;
    multiset<ll> Bs;
    vector<ll> A(n);
    vector<ll> B(n);
    auto calcA=[&](int i){
        return dp[i]-2*x[i+1]-x[i];
    };
    auto calcB=[&](int i){
        return dp[i]-x[i];
    };
    A[0]=calcA(0),B[0]=calcB(0);
    Bs.insert(B[0]);
    int iter=0;
    for(int i=1;i<=n;i++){
        while(iter<i && 2*(x[i]-x[iter+1])>=t){
            As.insert(A[iter]);
            Bs.erase(Bs.find(B[iter]));
            iter++;
        }
        ll vX=(As.empty() ? INF : *As.begin()+3*x[i]);
        ll vY=(Bs.empty() ? INF : *Bs.begin()+x[i]+t);
        dp[i]=min(vX,vY);
        if(i==n) break;
        A[i]=calcA(i),B[i]=calcB(i);
        Bs.insert(B[i]);
    }
    cout<<e-x[n]+dp[n]<<endl;
    return 0;
}#include<bits/stdc++.h>
using namespace std;

using ll=long long;
const ll INF=1e18;
int main(){
    int n;
    cin>>n;
    ll t,e;
    cin>>e>>t;
    vector<ll> x(n+1);
    for(int i=1;i<=n;i++) cin>>x[i];

    vector<ll> dp(n+1);    
    multiset<ll> As;
    multiset<ll> Bs;
    vector<ll> A(n);
    vector<ll> B(n);
    auto calcA=[&](int i){
        return dp[i]-2*x[i+1]-x[i];
    };
    auto calcB=[&](int i){
        return dp[i]-x[i];
    };
    A[0]=calcA(0),B[0]=calcB(0);
    Bs.insert(B[0]);
    int iter=0;
    for(int i=1;i<=n;i++){
        while(iter<i && 2*(x[i]-x[iter+1])>=t){
            As.insert(A[iter]);
            Bs.erase(Bs.find(B[iter]));
            iter++;
        }
        ll vX=(As.empty() ? INF : *As.begin()+3*x[i]);
        ll vY=(Bs.empty() ? INF : *Bs.begin()+x[i]+t);
        dp[i]=min(vX,vY);
        if(i==n) break;
        A[i]=calcA(i),B[i]=calcB(i);
        Bs.insert(B[i]);
    }
    cout<<e-x[n]+dp[n]<<endl;
    return 0;
}