#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
const int maxn=100010;
int n,e;
ll T;
int x[maxn];
ll f[maxn];

int main()
{
	scanf("%d%d",&n,&e);
	cin>>T;
	for (int i=1;i<=n;i++)
		scanf("%d",&x[i]);
	f[0]=0;
	f[1]=T;
	int la=0;
	ll minx=1LL<<60;
	for (int i=2;i<=n;i++)
	{
		while (2LL*(x[i]-x[la+1])>T)
		{
			ll tmp=f[la]-2LL*x[la+1];
			if (minx>tmp)	minx=tmp;
			la++;
		}
		f[i]=f[i-1]+T;
		if (la>0)
			f[i]=min(f[i],minx+2LL*x[i]);
		f[i]=min(f[i],f[la]+T);
	}
	cout<<f[n]+e<<endl;
	return 0;
}