#include<bits/stdc++.h>
using namespace std;
#define nn 200006
#define ll long long
ll n,t,e;
ll x[nn];ll f[nn];
int main()
{
	scanf("%lld%lld%lld",&n,&e,&t);
	for(int i=1;i<=n;i++) scanf("%lld",&x[i]);
	deque<int> q;ll oops=1e17;
	q.push_back(0);x[0]=0;int ls=0;
	for(int i=1;i<=n;i++)
	{
		while(ls<i and 2*(x[i]-x[ls+1])>t)
		{
			if(q.size() and ls==q.front()) q.pop_front();
			oops=min(oops,f[ls]-x[ls+1]*2-x[ls]);
			ls++;
		}
		
		if(q.size()) f[i]=f[q.front()]+t+x[i]-x[q.front()];
		else f[i]=1e17;
		f[i]=min(f[i],oops+x[i]*3);
		while(q.size() and f[q.back()]-x[q.back()]>=f[i]-x[i]) 
			q.pop_back();
		q.push_back(i);
	}	
	
	printf("%lld\n",f[n]+e-x[n]);
}
