#include<iostream>
#include<cstdio>
#include<cstring>
#define N 100010
using namespace std;
int n,t;
long long m;
long long f[N],x[N]; 
int main()
{
	scanf("%d%lld%d",&n,&m,&t);
	for(int i=1;i<=n;i++) scanf("%lld",&x[i]),f[i]=100000000000;
	long long minn=100000000000;
	int r=0;
	for(int i=1;i<=n;i++)
	{
		while(r<i && (x[i]-x[r+1])*2>=t)
		{
			minn=min(minn,f[r]-2*x[r+1]);
			r++;
		}
		f[i]=min(f[r]+t,minn+2*x[i]);
	}
	printf("%lld",f[n]+m);
	return 0;
}
