#include <bits/stdc++.h>

using namespace std;
#define X first
#define Y second
#define pb push_back
#define debug(x) cerr<<#x<<"="<<x<<endl;
typedef double db;
typedef long long ll;
typedef pair<int,int> P;
const int MAXN=1e5+10;
int q[MAXN],l,r;
ll d[MAXN],dp[MAXN];int n,E,T;

int main()
{
	scanf("%d%d%d",&n,&E,&T);
	for(int i=1;i<=n;i++) 
		scanf("%d",&d[i]),dp[i]=1ll<<60;
	ll mn=1ll<<60;l=r=1;
	for(int i=1;i<=n;i++)
	{
		while(l<=r&&2*(d[i]-d[q[l]+1])>T)
			mn=min(mn,dp[q[l]]-d[q[l]]-2*d[q[l]+1]),l++;
		dp[i]=min(dp[i],3*d[i]+mn);
		if(l<=r)dp[i]=min(dp[i],d[i]+T+dp[q[l]]-d[q[l]]);
		
		while(l<=r&&dp[i]-d[i]<=dp[q[r]]-d[q[r]]) r--;
		q[++r]=i;
	}
	printf("%lld",dp[n]+E-d[n]);
	return 0;
}