#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

typedef long long ll;

int a[100010],q[100010];
ll dp[100010],ma[100010];

int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	int n,E,T;scanf("%d%d%d",&n,&E,&T);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);a[0]=0;
	dp[0]=0;ma[0]=-a[1]*2;int f=1,r=1,k=0;q[1]=0;
	for (int i=1;i<=n;i++)
	{
		while (2*(a[i]-a[k+1])>T)
		{
			if (q[f]==k) f++;
			k++;
		}
		dp[i]=dp[q[f]]+a[q[f]+1]-a[q[f]]+T+a[i]-a[q[f]+1];
		if (k) dp[i]=min(dp[i],ma[k-1]+ll(a[i])*3);
		ma[i]=min(ma[i-1],dp[i]-a[i]-a[i+1]-a[i+1]);
		while (f<=r&&dp[q[r]]-a[q[r]]>=dp[i]-a[i]) r--;
		q[++r]=i;
	}
	cout<<dp[n]+E-a[n]<<endl;
	return 0;
}
