//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],bt[4*maxn];
void up(int u,int l,int r,int x,int y)
{
	if(r-l==1)
	{
		bt[u]=y;
		return ;
	}
	int md=(l+r)>>1;
	if(x<md)up(2*u,l,md,x,y);
	else up(2*u+1,md,r,x,y);
	bt[u]=min(bt[2*u],bt[2*u+1]);
}
int query(int u,int l,int r,int f,int s)
{
	if(l>=s||f>=r)return 1e18;
	if(f<=l&&r<=s)
	{
		return bt[u];
	}
	int md=(l+r)>>1;
	return min(query(2*u,l,md,f,s),query(2*u+1,md,r,f,s));
}
main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);
    cin>>n>>e>>t;
    rep(i,0,n)cin>>x[i];
    int v=0;
    while(v<n&&x[v]-x[0]<(t+1)/2)v++;
    if(v==n)
    {
    	cout<<t+e;
    	exit(0);
    }
    int g=0;
    if(v!=0)up(1,0,n,0,-2*x[0]);
    rep(i,v,n)
    {
        while(x[i]-x[g+1]>=(t+1)/2)g++;
    	dp[i]=2*x[i]+query(1,0,n,0,g+2);
    	up(1,0,n,i,dp[i-1]-2*x[i]);
    	if(g>=v)dp[i]=min(dp[i],dp[g]+t);
        else dp[i]=min(dp[i],2*t);
    }
    cout<<dp[n-1]+e;
}
