//dp[i]=min(dp[j]+max(T,(s[i]-s[j+1])*2)+(s[i]-s[j]));
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+10;
const long long inf=1LL<<60;
int s[maxn];
int n,E,T;
int head,tail,que[maxn];
long long dp[maxn];
long long tmp=inf;
int main()
{
    scanf("%d%d%d",&n,&E,&T);
    for(int i=1;i<=n;i++)scanf("%d",&s[i]);
    head=1,tail=0;
    que[++tail]=0;
    for(int i=1;i<=n;i++)
    {
        while(head<=tail&&2*(s[i]-s[que[head]+1])>T)tmp=min(tmp,dp[que[head]]-2*s[que[head]+1]),head++;
        dp[i]=min(dp[que[head]]+T,tmp+2*s[i]);
        que[++tail]=i;
    }
    printf("%lld\n",dp[n]+E);
}