#include <bits/stdc++.h>
using namespace std;
long long maxn=(1ll<<63-1);
long long a[10001],dp[10001]={0};
long long n,e,t,k=0;
int main()
{
	memset(dp,0x3f3f3f3f,sizeof(dp));
    cin>>n>>e>>t;
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]);
    for(int i=1;i<=n;i++)
    {
        while(t<=2*(a[i]-a[k+1]))
        {
            maxn=min(maxn,dp[k]-2*a[k+1]);
            k++;
        }
        dp[i]=dp[k]+t;
        dp[i]=min(dp[i],maxn+2*a[i]);
    }
    dp[n]+=e;
    cout<<dp[n]<<endl;
}#include<bits/stdc++.h>
using namespace std;
long long inf=(1ll<<63-1);
long long a[10005],dp[1005];    
long long n,e,t,maxn=inf;
int main()
{    
	memset(dp,(ll)0x3f3f3f3f,sizeof(dp));
    cin>>n>>e>>t;
    for(int i=1;i<=n;i++)
        cin>>a[i];
    dp[0]=0;
    int t=0;
    for(int i=1;i<=n;i++)
	{
        while(t<=2*(a[i]-a[t+1]))
        {
            maxn=min(maxn,dp[t]-2*a[t+1]);
            t++;
        }
        dp[i]=dp[t]+t;
        dp[i]=min(dp[i],maxn+2*a[i]);
    }
    dp[n]+=e;
    cout<<dp[n]<<endl;
}