//In the name of Allah
#include <bits/stdc++.h>
using namespace std;

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

const int maxN = 1000 * 100 + 10; 
ll a[maxN]; 
const ll inf = 1e18; 
ll dp[maxN]; 
set<pair<ll,int>> curr1, curr2; 

int main() { 
	ios::sync_with_stdio(false); cin.tie(0); 
	a[0] = 0; 
	int n,e,T; cin >> n >> e >> T;
	for( int i = 0 ; i < n ; i++ ) cin >> a[i+1]; 

	curr1.insert( { inf , -1 } ) ; 
	curr2.insert( { inf , -1 } ) ; 
	fill( dp , dp + n + 1 , inf ) ; 
	dp[0] = 0; 
	int last = 0; 
	curr1.insert( { 0ll , 0 } ); 
	for( int i = 1 ; i <= n ; i++ ) { 
		while( last < i && 2ll * (a[i] - a[last+1]) >= T ) { 
			curr1.erase( { 0ll + dp[last] ,  last } ) ; 
			curr2.insert( { 0ll + dp[last] - 2ll * a[last+1] , last } ); 
			last++; 
		}
		dp[i] = min( 0ll + curr1.begin()->first + T , 
				0ll + curr2.begin()->first + 2ll * a[i] ); 
		curr1.insert( { dp[i]  , i } ); 
	}
	cout << dp[n] + e << endl;
}

