#include<bits/stdc++.h>
#define ll long long
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
using namespace std;
int n,E,T,t,a[100005];
ll dp[100005];
int main(){
	scanf("%d%d%d",&n,&E,&T);
	For(i,1,n) scanf("%d",&a[i]);
	ll mn=1ll<<60;
	For(i,1,n){
		for (;T<=2*(a[i]-a[t+1]);t++)
			mn=min(mn,dp[t]-2*a[t+1]);
		dp[i]=min(dp[t]+T,mn+2*a[i]);
	}
	printf("%lld",E+dp[n]);
}