#include<cstdio>
#include<algorithm>
using namespace std;
#define MAXN 100010
#define LL long long
LL dp[MAXN],a[MAXN],T,tmp=1000000000000000LL;
int n,m,t;
int main()
{
	scanf("%d%d%lld",&n,&m,&T);
	for(int i=1;i<=n;i++)
		scanf("%lld",&a[i]);
	for(int i=1;i<=n;i++)
	{
		while(T<=2*(a[i]-a[t+1]))
			tmp=min(tmp,dp[t]-2*a[t+1]),t++;
		dp[i]=min(tmp+2*a[i],dp[t]+T);
	}
	printf("%lld\n",dp[n]+m);
}