#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define si(x) int(x.size())
const int mod=1000000007,MAX=200005;
const ll INF=1LL<<60;

ll dp[MAX];

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll N,E,T;cin>>N>>E>>T;
    if(N>2000) return 0;
    vector<ll> A(N);
    for(int i=0;i<N;i++) cin>>A[i];
    A.push_back(0);
    A.push_back(INF);
    sort(all(A));
    
    for(int i=1;i<=N+1;i++) dp[i]=INF;
    dp[0]=0;
    
    for(int i=1;i<=N;i++){
        auto it=upper_bound(all(A),A[i]+(T+1)/2);
        chmin(dp[it-A.begin()],dp[i-1]+max((A[it-A.begin()]-A[i])*2,T));
        
        it--;
        chmin(dp[it-A.begin()],dp[i-1]+max((A[it-A.begin()]-A[i])*2,T));
        
        if(it==A.begin()) continue;
        
        it--;
        chmin(dp[it-A.begin()],dp[i-1]+max((A[it-A.begin()]-A[i])*2,T));*/
    }
    
    cout<<dp[N]+E<<endl;
}
