#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N=100005;
int read(){
	int x=0;
	char ch=getchar();
	while (!isdigit(ch))
		ch=getchar();
	while (isdigit(ch))
		x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
	return x;
}
int n,T,E;
int x[N];
LL dp[N],Min=1LL<<50;
int main(){
	n=read(),E=read(),T=read();
	for (int i=1;i<=n;i++)
		x[i]=read();
	int j=1;
	dp[0]=0;
	for (int i=1;i<=n;i++){
		while (2LL*(x[i]-x[j])>=T){
			Min=min(Min,dp[j-1]-2LL*x[j]);
			j++;
		}
		dp[i]=min(Min+2LL*x[i],dp[max(j-1,0)]+T);
	}
	printf("%lld",dp[n]+E);
	return 0;
}