#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int MAXN = 1e5 + 5;
const ll linf = 0x3f3f3f3f3f3f3f3f;

inline void chk_min(ll &a,ll b){ if(a>b) a=b;}

struct Queue
{
	int q[MAXN],hd,tl;
	Queue(void){ hd=tl=0;}
	inline bool empty(void){ return hd>=tl;}
	inline int front(void){ return q[hd+1];}
	inline int back(void){ return q[tl];}
	inline void push(int x){ q[++tl]=x;}
	inline void pop(void){ ++hd;}
}q;

int a[MAXN];
ll dp[MAXN];

int main(void)
{
	int n,e,t;
	scanf("%d%d%d",&n,&e,&t);
	for(int i=1; i<=n; ++i) scanf("%d",&a[i]);
	
	memset(dp,0x3f,sizeof(dp));
	
	dp[0]=0;
	q.push(0);
	ll mn=linf;
	for(int i=1; i<=n; ++i)
	{
		while(!q.empty() && (a[i]-a[q.front()+1])*2 > t)
			chk_min(mn, dp[q.front()] - 2*a[q.front()+1]),
			q.pop();
		
		if(!q.empty()) chk_min(dp[i], dp[q.front()]+t);
		
		chk_min(dp[i], mn+2*a[i]);
		q.push(i);
	}
	printf("%lld\n",dp[n]+e);
	return 0;
}