#include<bits/stdc++.h>

using namespace std;

typedef long long LL;
#define N 120000
#define INF 0x3f3f3f3f3f3f3f3fLL

LL a[N],n,m,t,f[N],g[N];

int main(){
	scanf("%lld%lld%lld",&n,&m,&t);
	for (LL i=1;i<=n;++i) scanf("%lld",a+i);
	g[0]=-a[1]*2;
	for (LL i=1,j=0;i<=n;++i){
		for (;t<2*(a[i]-a[j+1]);++j);
		f[i]=min(j>0?g[j-1]+a[i]*3:INF,f[j]+a[i]-a[j]+t);
		g[i]=min(g[i-1],f[i]-a[i]-a[i+1]*2);
	}
	printf("%lld\n",f[n]+m-a[n]);
	
	return 0;
}
			