#include <iostream>
#include <cstdio>
#include <cstring>
#define lowbit(x) (x&-x)
using namespace std;
const int MAXN = 100005;
typedef long long ll;
const ll INF=0x3f3f3f3f3f3f3f3f;
ll t,e,n,d[MAXN];
ll c[MAXN],f[MAXN];
inline void update(int x,ll v)
{
	for(;x<=n;x+=lowbit(x))
		c[x]=min(c[x],v);
}
inline ll query(int x)
{
	ll ret=INF;
	for(;x;x-=lowbit(x))
		ret=min(ret,c[x]);
	return min(ret,(ll)-2*d[1]);
}
int main()
{
	scanf("%lld%lld%lld",&n,&e,&t);
	for(int i=1;i<=n;++i)scanf("%lld",d+i);
	int p=0;
	memset(f,0x3f,sizeof(f));
	f[0]=0;
	for(int i=1;i<=n;++i){
		while(2*(d[i]-d[p+1])>=t)++p;
		if(p>0)f[i]=min(f[i],query(p-1)+2*d[i]);
		f[i]=min(f[i],f[p]+t);
		update(i,f[i]-2*d[i+1]);
	}
	cout<<f[n]+e<<endl;
	return 0;
}
