#include <bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define RFOR(i,b,a) for (int i = (b)-1; i >= (a); i--)
#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a,value) memset(a, value, sizeof(a))

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;

const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const ll LINF = INF * (ll) INF;
ll dp[100001];
int N , E , T;
int a[100001];
ll dpRMQ[100001];
int opt = 0;
ll cost(int i , int opt)
{
	ll prev = 0;

	prev = dp[opt - 1];

	ll cur = max((a[i] - a[opt]) * 2 , T);

	return prev + cur;
}
int findOpt(int idx)
{
	return lower_bound(a , a + N , a[idx] - T / 2) - a;
}
ll findDp(int idx)
{
	int opt = findOpt(idx);
	//cout << opt << endl;
	ll dp1 = T;
	if(opt - 1 >= 0)
		dp1 += dp[opt - 1];
	ll dp2 = a[idx] * 2;
	if(opt - 1 >= 0)
		dp2 += min(dpRMQ[opt - 1] , 0);
	//cout << dp1 << " " << dp2 << endl;
	//if(opt < idx)
		return(min(dp1 , dp2));
	//else
		//return dp2;
}
int main()
{
	scanf("%d %d %d" , &N , &E , &T);
	for(int i = 0; i < N; i++)
	{
		scanf("%d" , &a[i]);
	}
	dp[0] = T;
	dpRMQ[0] = - a[0] * 2;
	for(int i = 1; i < N; i++)
	{
		dp[i] = findDp(i);
		dpRMQ[i] = min(dpRMQ[i - 1] , dp[i - 1] - a[i] * 2);
	}
	cout << dp[N - 1] + E;
}


