//InTheNameOfGod
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,j,k) for(int i=j;i<k;++i)
#define rrep(i,j,k) for(int i=j;i>=k;i--)
#define pb push_back
#define int ll
const int maxn =2e5;
int n,e,t,dp[maxn],x[maxn],pm[4*maxn];
main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);
    cin>>n>>e>>t;
    rep(i,1,n+1)cin>>x[i];
    int g=0;
    pm[0]=-2*x[1];
    rep(i,1,n+1)
    {
        while(x[g+1]<=x[i]-t/2.0)g++;
        dp[i]=min(t+dp[g],2*x[i]+pm[g-1]);
        pm[i]= min(pm[i-1],dp[i]-2*x[i+1]);
    }
    cout<<dp[n]+e;
}
