/*
                ____________    ______________       __
               / _________  /\ /_____   _____/\     / /\
              / /\       / /  \\    /  /\    \ \   / /  \
             / /  \_____/ /   / \__/  /  \____\/  / /   /
            / /   /    / /   /    /  /   /       / /   /
           / /   /    / /   /    /  /   /       / /   /
          / /   /    / /   /    /  /   /       / /   /
         / /___/____/ /   /    /  /   /       / /___/________
        /____________/   /    /__/   /       /______________/\
        \            \  /     \  \  /        \              \ \
         \____________\/       \__\/          \______________\/
           ___       ___               ___    __________
          /  /\     /  /\             /  /\  /_______  /\
         /  /__\___/  /  \           /  /  \ \      /  /  \
        /____    ____/   /          /  /   /  \____/  /   /
        \   /   /\   \  /          /  /   /       /  /   /
         \_/   /  \___\/ ___      /  /   /       /  /   /
          /   /   /     /  /\    /  /   /       /  /   /
         /   /   /     /  /__\__/  /   /       /  /___/____
        /___/   /     /___________/   /       /___________/\
        \   \  /      \           \  /        \           \ \
         \___\/        \___________\/          \___________\/
       
          A FAN OF FIZZYDAVID
           
*/
 
#include<bits/stdc++.h>
 
#define HEAP priority_queue
#define rep(i,n) for(int i=0;i<(n);i++)
#define per(i,n) for(int i=(n)-1;i>=0;i--)
#define forn(i,l,r) for(int i=(l);i<=(r);i++)
#define nrof(i,r,l) for(int i=(r);i>=(l);i--)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define X first
#define Y second
#define eps 1e-20
#define pi 3.1415926535897932384626433832795
#define orz int
#define yjz main
#define fizzydavid return
#define ak 0
#define la ;
#define debug puts("OK");
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(),x.end()
 
using namespace std;
 
typedef long long LL;
typedef double flt;
typedef vector<int> vi;
typedef pair<int,int> pii;
 
const int iinf=1e9+7;
const LL linf=1ll<<60;
const flt dinf=1e10;
 
template <typename T>
inline void scf(T &x)
{
	bool f=0; x=0; char c=getchar();
	while((c<'0' || c>'9') && c!='-') c=getchar();
	if(c=='-') { f=1; c=getchar(); }
	while(c>='0' && c<='9') { x=x*10+c-'0'; c=getchar(); }
	if(f) x=-x; return;
}
 
template <typename T1,typename T2>
void scf(T1 &x,T2 &y) { scf(x); return scf(y); }
 
template <typename T1,typename T2,typename T3>
void scf(T1 &x,T2 &y,T3 &z) { scf(x); scf(y); return scf(z); }
 
#ifdef ONLINE_JUDGE
#else
//#define DEBUG
#endif
 
//---------------------------head----------------------------
 
const int N=1e5+100;
 
int n;
LL T;
LL dp[N],x[N];
 
namespace seg1//dp[j]+2*x[j-1]+x[j]
{
	LL num[N<<2];
	inline int L(int i){ return i<<1; }
	inline int R(int i){ return (i<<1)|1; }
	inline void update(int i){ num[i]=min(num[L(i)],num[R(i)]); return; }
	inline void modify(int i,LL x,int l=1,int r=n,int k=1)
	{
		if(l==r){ num[k]=x; return; }
		int mid=l+r>>1;
		if(i<=mid) modify(i,x,l,mid,L(k));
		else modify(i,x,mid+1,r,R(k));
		return update(k);
	}
	inline LL query(int a,int b,int l=1,int r=n,int k=1)
	{
		if(a==l && b==r) return num[k];
		int mid=l+r>>1;
		if(a>mid) return query(a,b,mid+1,r,R(k));
		if(b<=mid) return query(a,b,l,mid,L(k));
		return min(query(a,mid,l,mid,L(k)),query(mid+1,b,mid+1,r,R(k)));
	}
}
 
namespace seg2//dp[j]+T+x[j]
{
	LL num[N<<2];
	inline int L(int i){ return i<<1; }
	inline int R(int i){ return (i<<1)|1; }
	inline void update(int i){ num[i]=min(num[L(i)],num[R(i)]); return; }
	inline void modify(int i,LL x,int l=1,int r=n,int k=1)
	{
		#ifdef DEBUG
		cout<<i<<' '<<x<<' '<<l<<' '<<r<<' '<<k<<endl;
		#endif
		if(l==r){ num[k]=x; return; }
		int mid=l+r>>1;
		if(i<=mid) modify(i,x,l,mid,L(k));
		else modify(i,x,mid+1,r,R(k));
		return update(k);
	}
	inline LL query(int a,int b,int l=1,int r=n,int k=1)
	{
		#ifdef DEBUG
		cout<<'['<<a<<','<<b<<']'<<' '<<l<<' '<<r<<' '<<k<<endl;
		#endif
		if(a==l && b==r) return num[k];
		int mid=l+r>>1;
		if(a>mid) return query(a,b,mid+1,r,R(k));
		if(b<=mid) return query(a,b,l,mid,L(k));
		return min(query(a,mid,l,mid,L(k)),query(mid+1,b,mid+1,r,R(k)));
	}
}
 
orz yjz()
{
	scf(n); scf(x[(++n)]); scf(T);
	forn(i,1,n-1) scf(x[i]);
	seg1::modify(n,2*x[n-1]+x[n]);
	seg2::modify(n,T+x[n]);
	nrof(i,n-1,1)
	{
		dp[i]=linf;
		int lb=i+1,rb=n;
		while(lb<=rb)
		{
			int mid=lb+rb>>1;
			LL calc=2*(x[mid-1]-x[i]);
			if(calc>T) rb=mid-1; else lb=mid+1;
		}//rb
		LL t1=lb<=n?seg1::query(lb,n)-3*x[i]:linf;
		LL t2=i<rb?seg2::query(i+1,rb)-x[i]:linf;
		dp[i]=min(t1,t2);
		#ifdef DEBUG
		cout<<i<<' '<<rb<<'\t'<<seg1::query(lb,n)<<' '<<t1<<'\t'<<seg2::query(i+1,rb)<<' '<<t2<<' '<<dp[i]<<endl;
		#endif
		seg1::modify(i,dp[i]+2*x[i-1]+x[i]);
		seg2::modify(i,dp[i]+T+x[i]);
	}
	printf("%lld\n",dp[1]+x[1]);
	fizzydavid ak la
}

Measured memory_bytes: 8064