#include<bits/stdc++.h>
using namespace std;
int N,E,T;
int x[100005];
long long f[100005];
int main(){
	scanf("%d%d%d",&N,&E,&T);
	for(int i=1;i<=N;i++) scanf("%d",&x[i]);x[0]=x[1];
	long long ans=1e18,mn=1e18;
	for(int i=1,p=1;i<=N;i++){
		while(p<N&&(x[i]-x[p])>T/2) {
			mn=min(mn,f[p-1]-x[p]*2-x[p-1]);
			p++;
		}
		f[i]=min(f[p-1]+x[i]-x[p-1]+T,mn+x[i]*3LL);
	}
	ans=min(ans,f[N]+x[1]+E-x[N]);
	cout<<ans<<endl;
	return 0;
}