#include<bits/stdc++.h>
using namespace std;
#define int long long
#define mp make_pair
#define fi first
#define se second
const int N=100005;
set<pair<int ,int> >s;
int n,e,t,x[N],f[N],dp[N],d[N];
signed main(){
	scanf("%lld%lld%lld",&n,&e,&t);
	for (int i=1;i<=n;i++)scanf("%lld",&x[i]);
	e-=x[n];x[n+1]=e;
	for (int i=n;i;i--)x[i]-=x[i-1];
	for (int i=1;i<=n;i++)f[i]=f[i-1]+x[i];
	int l=0,r=-1,k=0;
	s.insert(mp(0,0));
	for (int i=1;i<=n;i++){
		while (k<i&&(f[i]-f[k+1])*2>t){
			s.erase(mp(x[k+1]-f[k+1]+dp[k],k));
			while (l<=r&&-3*f[k+1]+x[k+1]+dp[k]<=-3*f[d[r]+1]+x[d[r]+1]+dp[d[r]])r--;
			d[++r]=k;
			k++;
		}
		pair<int ,int > now=*s.begin();
		dp[i]=t+now.fi+f[i];
		if (l<=r)dp[i]=min(dp[i],f[i]*3-3*f[d[l]+1]+x[d[l]+1]+dp[d[l]]);
		s.insert(mp(x[i+1]-f[i+1]+dp[i],i));
	}
	printf("%lld\n",dp[n]+e);
}