#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<iostream>
#define LL long long
#define N 110000
using namespace std;
LL x[N],f[N],s[N],inf=1ll<<50,ans,ed,t;
int p[N],head,tail,n;
int main()
{
	scanf("%d%lld%lld",&n,&ed,&t);
	for(int i=1;i<=n;i++) scanf("%lld",&x[i]);
	s[0]=t;
	int j=0;
	head=tail=1;p[1]=0;
	s[0]=-2*x[1];
	for(int i=1;i<=n;i++)
	{
		f[i]=inf;
		while(2*(x[i]-x[j+1])>t) j++;
		if(j>0) f[i]=3*x[i]+s[j-1];
		while(head<=tail && p[head]<j) head++;
		if(head<=tail) f[i]=min(f[i],f[p[head]]+x[i]-x[p[head]]+t);
		while(head<=tail && f[p[tail]]-x[p[tail]]>=f[i]-x[i]) tail--;
		p[++tail]=i;
		s[i]=min(s[i-1],f[i]-x[i]-2*x[i+1]);
	}
	ans=f[n]+ed-x[n];
	printf("%lld\n",ans);
	return 0;
}