#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<set>
using namespace std;

const int MAXN=100005 ;
int n , E, T , dis[MAXN] ;
long long dp[MAXN] ;

multiset<long long> st;
multiset<long long>::iterator it ;

long long calc_1(int j){
	return dp[j]-2*dis[j+1]-dis[j] ;
}

long long calc_2(int j){
	return dp[j]-dis[j] ;
}

int main(){
	scanf("%d%d%d",&n,&E,&T) ;
	memset(dp,0x3f,sizeof(dp)) ;
	for(int i=1;i<=n;++i) scanf("%d",&dis[i]) ;
	dp[0]=0 ;
	int last=0 ; //第一个满足边界的
	st.insert(calc_2(0)) ;
	long long minn=(1ll<<60)-1 ;
	for(int i=1;i<=n;++i){
		while(last<i && 2*(dis[i]-dis[last+1])>=T){
			long long tmp=calc_2(last) ;
			it=st.find(tmp) , st.erase(it) ;
			minn=min(minn,calc_1(last)) , ++last ;
		}
		dp[i]=minn+(long long)3*dis[i] ;
		if(!st.empty()) dp[i]=min(dp[i],(*st.begin())+T+dis[i]) ;
		st.insert(calc_2(i)) ;
	}
	cout << dp[n]+E-dis[n] << '\n' ;
	return 0 ;
}