#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define int ll
#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)
using vi=vector<int>;
#define PB push_back
#define ALL(x) x.begin()
using pi=pair<int,int>;

int read(){
	int i;
	scanf("%lld",&i);
	return i;
}
int const inf=LLONG_MAX/3;
void chmin(int&a,int b){a=a<b?a:b;}
void chmax(int&a,int b){a=a>b?a:b;}

signed main(){
	int n=read(),e=read(),t=read();
	vi x{0};
	REP(i,n)x.PB(read());
	n++;
	vi dp(n,inf);
	priority_queue<pi,vector<pi>,greater<pi>> pq;
	pq.push(pi(0,0));
	int j=0;
	REP(i,n){
		int w;
		while(1){
			pi r=pq.top();
			if(i<=r.second){
				w=min(r.first,dp[i]);
				break;
			}else
				pq.pop();
		}
		if(i==n-1){
			cout<<w+e<<endl;
			return 0;
		}
		chmin(dp[i+1],dp[i]+(x[i+1]-x[i])*2);
		while(j<n&&(x[j]-x[i+1])*2<=t)j++;
		pq.push(pi(w+t,j-1));
		if(j<n)chmin(dp[j],w+(x[j]-x[i+1])*2);
	}
}
