#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>

using namespace std;

typedef long long ll;

const int N=100009;
const ll Inf=1e18;

int n,t,e;
int x[N];
ll f[N],smn,ff[N];

inline int read()
{
	int x=0;char ch=getchar();
	while(ch<'0' || '9'<ch)ch=getchar();
	while('0'<=ch && ch<='9')x=x*10+(ch^48),ch=getchar();
	return x;
}
inline void chkmin(ll &a,ll b){if(a>b)a=b;}

int main()
{
	n=read();
	e=read();
	t=read();
	for(int i=1;i<=n;i++)
		x[i]=read();

	f[0]=0;
	ff[0]=-2*x[1];
	int ptr=0;
	for(int i=1;i<=n;i++)
	{
		while(2ll*(x[i]-x[ptr+1])>t)ptr++;
		f[i]=f[ptr]+t;
		if(ptr)chkmin(f[i],2*x[i]+ff[ptr-1]);
		ff[i]=min(f[i]-2*x[i+1],ff[i-1]);
	}

	printf("%lld\n",f[n]+e);
	return 0;
}
