#include<bits/stdc++.h>
#define ll long long 
#define pii pair<int,int>
#define iiii pair<int,pii >
#define ld double 
#define MAXN 100100
#define inf 1000000000000000000ll
using namespace std;

ll Dp[MAXN],e,t,q=inf,a[MAXN];
int n,p;




int main()
{
	scanf("%d%lld%lld",&n,&e,&t);
	for(int i=1;i<=n;i++)scanf("%lld",a+i);

	for(int i=1;i<=n;i++)
	{
		while ((a[i]-a[p+1])*2>=t)
		{
			q=min(q,Dp[p]-a[p+1]*2-a[p]);
			p++;
		}
		Dp[i]=min(3ll*a[i]+q,Dp[p]+a[i]-a[p]+t);
	}
	
	 
	printf("%lld\n",Dp[n]-a[n]+e);

	
	return 0;
} 