#include <bits/stdc++.h>
#define int long long
#define INF 1000000000000000007ll
using namespace std;

int n,e,t,a[100010],dp[100010];

signed main()
{
	ios::sync_with_stdio(false);
	cin>>n>>e>>t;
	for(int i=1;i<=n;i++) cin>>a[i];
	int minv=INF,pos=0;
	for(int i=1;i<=n;i++){
		while(2*(a[i]-a[pos+1])>t){
			minv=min(minv,dp[pos]-2*a[pos+1]);
			pos++;
		}
		dp[i]=min(minv+2*a[i],dp[pos]+t);
	}
	cout<<dp[n]+e<<endl;
	return 0;
}