#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <deque>
#include <bits/stdc++.h>
//#include "testlib.h"
using namespace std;
#define ll long long
#define pii pair<int,int>
#define qi ios::sync_with_stdio(0)

bool debug=true;

/*    *************************************
	  * Written in New Computer           *
	  * The following code belongs to     *
	  * XiaoGeNintendo of HellHoleStudios *
	  *************************************
*/
template<typename T1,typename T2>ostream& operator<<(ostream& os,pair<T1,T2> ptt){
	os<<ptt.first<<","<<ptt.second;
	return os;
}
template<typename T>ostream& operator<<(ostream& os,vector<T> vt){
	os<<"{";
	for(int i=0;i<vt.size();i++){
		os<<vt[i]<<" ";
	}
	os<<"}";
	return os;
}

ll n,t,e;
ll dp[100005];
ll x[100005];
int main(int argc,char* argv[]){
	qi;
	cin>>n>>e>>t;
	for(int i=0;i<n;i++){
		cin>>x[i];
	}
	
	//dp[i]=min{dp[j]+max{t,2*(x[i]-x[j])}}
	//dp[i]=min{dp[j]+2*(x[i]-x[j])} or dp[i]=min{dp[j]+t} <-easy
	//dp[i]=2*x[i]+min{dp[j]-2*x[j])} 
	ll last=0,mn=-2*x[0];
	for(int i=0;i<n;i++){
		if(2*(x[i]-x[0])<=t){
			dp[i]=t;
			continue;
		}
	
		while(2*(x[i]-x[last+1])>t){
			mn=min(mn,dp[last]-2*x[last+1]);
			last++;
		}
		
		dp[i]=min(mn+2*x[i],dp[last]+t);
	}
	
	cout<<dp[n-1]+e<<endl;
	return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <deque>
#include <bits/stdc++.h>
//#include "testlib.h"
using namespace std;
#define ll long long
#define pii pair<int,int>
#define qi ios::sync_with_stdio(0)

bool debug=true;

/*    *************************************
	  * Written in New Computer           *
	  * The following code belongs to     *
	  * XiaoGeNintendo of HellHoleStudios *
	  *************************************
*/
template<typename T1,typename T2>ostream& operator<<(ostream& os,pair<T1,T2> ptt){
	os<<ptt.first<<","<<ptt.second;
	return os;
}
template<typename T>ostream& operator<<(ostream& os,vector<T> vt){
	os<<"{";
	for(int i=0;i<vt.size();i++){
		os<<vt[i]<<" ";
	}
	os<<"}";
	return os;
}

ll n,t,e;
ll dp[100005];
ll x[100005];
int main(int argc,char* argv[]){
	qi;
	cin>>n>>e>>t;
	for(int i=0;i<n;i++){
		cin>>x[i];
	}
	
	//dp[i]=min{dp[j]+max{t,2*(x[i]-x[j])}}
	//dp[i]=min{dp[j]+2*(x[i]-x[j])} or dp[i]=min{dp[j]+t} <-easy
	//dp[i]=2*x[i]+min{dp[j]-2*x[j])} 
	ll last=0,mn=-2*x[0];
	for(int i=0;i<n;i++){
		if(2*(x[i]-x[0])<=t){
			dp[i]=t;
			continue;
		}
	
		while(2*(x[i]-x[last+1])>t){
			mn=min(mn,dp[last]-2*x[last+1]);
			last++;
		}
		
		dp[i]=min(mn+2*x[i],dp[last]+t);
	}
	
	cout<<dp[n-1]+e<<endl;
	return 0;
}

