// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



long long f[100010],c[100010],d[100010];

int x[100010];

int n,e,t,T;



inline void add1(int x,long long o)

{

	while(x<=n)

	{

		c[x]=min(c[x],o);

		x+=x&-x;

	}

}



inline long long ask1(int x)

{

	long long nowans=0x3f3f3f3f3f3f3f3fll;

	while(x)

	{

		nowans=min(nowans,c[x]);

		x-=x&-x;

	}

	return nowans;

}



inline void add2(int x,long long o)

{

	while(x)

	{

		d[x]=min(d[x],o);

		x-=x&-x;

	}

}



inline long long ask2(int x)

{

	long long nowans=0x3f3f3f3f3f3f3f3fll;

	while(x<=n)

	{

		nowans=min(nowans,d[x]);

		x+=x&-x;

	}

	return nowans;

}



int main()

{

	scanf("%d%d%d",&n,&e,&t);

	T=t;

	if(t%2)T++;

	for(int i=1;i<=n;i++)

		scanf("%d",&x[i]);

	memset(f,0x3f,sizeof(f));

	memset(c,0x3f,sizeof(c));

	memset(d,0x3f,sizeof(d));

	f[0]=0;

	for(int i=1;i<=n;i++)

	{

		f[i]=min(f[i],f[i-1]+x[i]-x[i-1]+t);

		int now=upper_bound(x+1,x+1+i,x[i]-T/2)-x;

		if(x[i]-T/2>=x[1])

		{

			now--;

			long long nowans=ask1(now);

			f[i]=min(f[i],3ll*x[i]+nowans);

		}

		if(x[i]-T/2<x[1])now=0;

		now++;

		long long nowans=ask2(now);

		f[i]=min(f[i],x[i]+nowans);

		/*for(int j=i+1;j<=n;j++)

		{

			if((x[j]-x[i])*2>=t)f[j]=min(f[j],f[i-1]+3ll*(x[j]-x[i])+x[i]-x[i-1]);

			else f[j]=min(f[j],f[i-1]+t-2*(x[j]-x[i])+3ll*(x[j]-x[i])+x[i]-x[i-1]);

		}*/

		add1(i,-3ll*x[i]+f[i-1]+x[i]-x[i-1]);

		add2(i,0ll+t-x[i]+x[i]+f[i-1]-x[i-1]);

	}

	cout<<f[n]+e-x[n];

}

// Faster C++ solution for the same problem (measured speedup: 3.438031514332294x):
#include<iostream>

#include<cstdio>

#include<cstdlib>

using namespace std;



#define lowbit(a) (a&-a)

typedef long long ll;

const int maxn = 100010; const ll inf = 1LL<<60;

int N,T,E,X[maxn]; ll tree1[4*maxn],tree2[4*maxn],f[maxn];



inline int gi()

{

	char ch; int ret = 0,f = 1;

	do ch = getchar(); while (!(ch >= '0'&&ch <= '9')&&ch != '-');

	if (ch == '-') f = -1,ch = getchar();

	do ret = ret*10+ch-'0',ch = getchar(); while (ch >= '0'&&ch <= '9');

	return ret*f;

}



inline void build(int now,int l,int r)

{

	tree1[now] = tree2[now] = inf;

	if (l == r) return; int mid = (l+r) >> 1;

	build(now<<1,l,mid); build(now<<1|1,mid+1,r);

}



inline void modify(ll *tree,int now,int l,int r,int pos,ll key)

{

	if (l == r) { tree[now] = key; return; } int mid = (l+r)>>1;

	if (pos <= mid) modify(tree,now<<1,l,mid,pos,key);

	else modify(tree,now<<1|1,mid+1,r,pos,key);

	tree[now] = min(tree[now<<1],tree[now<<1|1]);

}



inline ll query(ll *tree,int now,int l,int r,int ql,int qr)

{

	if (ql == l&&qr == r) return tree[now]; int mid = (l+r)>>1;

	if (qr <= mid) return query(tree,now<<1,l,mid,ql,qr);

	else if (ql > mid) return query(tree,now<<1|1,mid+1,r,ql,qr);

	else return min(query(tree,now<<1,l,mid,ql,mid),query(tree,now<<1|1,mid+1,r,mid+1,qr));

}



int main()

{

	//freopen("G.in","r",stdin);

	//freopen("G.out","w",stdout);

	N = gi(); E = gi(); T = gi();

	for (int i = 1;i <= N;++i) X[i] = gi(),tree1[i] = tree2[i] = 1LL<<60;

	for (int i = 1;i <= N;++i)

	{

		modify(tree1,1,1,N,i,f[i-1]-2LL*(ll)X[i]-(ll)X[i-1]);

		modify(tree2,1,1,N,i,f[i-1]-(ll)X[i-1]);

		int l = 0,r = i-1,mid; f[i] = inf;

		while (l <= r)

		{

			mid = (l+r)>>1;

			if (T-2LL*(X[i]-X[mid+1]) > 0) r = mid-1;

			else l = mid+1;

		}

		if (r+1) f[i] = query(tree1,1,1,N,1,r+1)+3LL*X[i];

		if (r+2 <= i) f[i] = min(f[i],query(tree2,1,1,N,r+2,i)+(ll)X[i]+(ll)T);

	}

	cout << f[N]+(ll)E-(ll)X[N] << endl;

	return 0;

}