#include<bits/stdc++.h>
using namespace std;
#define RI register int
int read() {
	int q=0;char ch=' ';
	while(ch<'0'||ch>'9') ch=getchar();
	while(ch>='0'&&ch<='9') q=q*10+ch-'0',ch=getchar();
	return q;
}
typedef long long LL;
const int N=100005;
int n;LL f[N],d[N],mi,E,T;
int main()
{
	n=read(),E=read(),T=read();
	for(RI i=1;i<=n;++i) d[i]=read();
	mi=1e15;
	for(RI i=1,j=0;i<=n;++i) {
		while(j<i&&(d[i]-d[j+1])*2>T) mi=min(mi,f[j]-2*d[j+1]),++j;
		f[i]=mi+2*d[i];
		if(j<i&&f[j]+T<f[i]) f[i]=f[j]+T;
	}
	printf("%lld\n",f[n]+E);
	return 0;
}