#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<functional>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
using namespace std;
#define MOD 1000000007
#define f(i,n) for(int i=0;i<int(n);i++)
#define N 200000


int main(){
	long long a[N];
	long long dp[N];
	priority_queue<pair<long long, long long> >q;
	f(i, N){
		a[i] = 0;
		dp[i] = 0;
	}
	int n, k;
	long long x, y, z;
	long long s, ans, t;
	bool v = true;
	ans = 0;
	scanf("%d %lld %lld", &n, &s, &t);
	ans = s;
	f(i, n){
		scanf("%lld", &a[i]);
	}
	if (n == 1){
		printf("%lld\n", s + t);
		return 0;
	}
	dp[0] = t;
	q.push(make_pair(a[1] - dp[0], a[1]));
	q.push(make_pair(a[0], a[0]));
	s = 100000000000000000;
	for (int i = 1; i<n; i++){
		while (true){
			x = -q.top().first;
			y = q.top().second;
			if (2*(a[i] - y)>t){
				s = min(s, x - y);
				q.pop();
			}
			else break;
		}
		x = -q.top().first;
		dp[i] = min(t + x + a[i], s + (2 * a[i]));
		if (i < n - 1)	q.push(make_pair(a[i + 1] - dp[i], a[i + 1]));
	}
	ans += dp[n - 1];
	printf("%lld\n", ans);


	return 0;
}