#include<set>
#include<map>
#include<cmath>
#include<queue>
#include<bitset>
#include<string>
#include<cstdio>
#include<cctype>
#include<cstdlib>
#include<cstring>
#include<cassert>
#include<sstream>
#include<numeric>
#include<iostream>
#include<algorithm>
#include<functional>

#define For(i,x,y) for (int i=x;i<y;i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define Lsn (x<<1)
#define Rsn (x<<1|1)
#define Mid (L+R>>1)

#define dprintf(...) fprintf(stderr,__VA_ARGS__)
using namespace std;

typedef long long ll;
typedef double db;
typedef vector<int> Vi;
typedef pair<int,int> pii;

int IN(){
	int c,f,x;
	while (!isdigit(c=getchar())&&c!='-');c=='-'?(f=1,x=0):(f=0,x=c-'0');
	while (isdigit(c=getchar())) x=(x<<1)+(x<<3)+c-'0';return !f?x:-x;
}

const int N=100000+19;
const ll oo=1ll<<50;

ll f[N];
int d[N],E,T,n,l,r,res;

ll Qv;
int Ql,Qr,Qx;

struct SegTree{
	ll mn[N*4];
	SegTree(){
		For(i,0,N*4) mn[i]=oo;
	}
	void Modify(int x,int L,int R){
		mn[x]=min(mn[x],Qv);
		if (L==R) return;
		if (Qx<=Mid) Modify(Lsn,L,Mid);else Modify(Rsn,Mid+1,R);
	}
	ll Query(int x,int L,int R){
		if (Ql<=L&&R<=Qr) return mn[x];
		ll res=oo;
		if (Ql<=Mid) res=min(res,Query(Lsn,L,Mid));
		if (Qr>Mid) res=min(res,Query(Rsn,Mid+1,R));
		return res;
	}
} S1,S2;

int main(){
	n=IN(),E=IN(),T=IN();
	For(i,1,n+1) d[i]=IN();
	For(i,0,N) f[i]=oo;
	f[0]=0;
	For(i,1,n+1){
		Qx=i,Qv=f[i-1]+d[i]-d[i-1]-3*d[i];
		S1.Modify(1,1,n);
		Qx=i,Qv=f[i-1]+d[i]-d[i-1]-d[i];
		S2.Modify(1,1,n);
		
		l=1,r=i;res=0;
		while (l<=r){
			int mid=(l+r>>1);
			if (2*(d[i]-d[mid])>T) res=mid,l=mid+1;else r=mid-1;
		}
		Ql=1,Qr=res;
		if (Ql<=Qr) f[i]=min(f[i],S1.Query(1,1,n)+3ll*d[i]);
		Ql=res+1,Qr=i;
		if (Ql<=Qr) f[i]=min(f[i],S2.Query(1,1,n)+T+d[i]);
		/*
		For(j,1,i+1){
			f[i]=min(f[i],f[j-1]+d[j]-d[j-1]+max(2*(d[i]-d[j]),T)+d[i]-d[j]);
		}
		*/
	}
	cout<<f[n]+E-d[n]<<endl;
}