#include <bits/stdc++.h>
using namespace std;

#define int long long

const int N = 1e5 + 5;

int A[N], n, T, E, dp[N];

int calc(int x, int y) {
	if(y == x + 1) return dp[x] + A[y] - A[x] + T;
	else return dp[x] + A[x + 1] - A[x] + (A[y] - A[x + 1]) * 3 + max(0LL, T - (A[y] - A[x + 1]) * 2);
}

main() {
	cin >> n >> E >> T;
	for(int i = 1; i <= n; ++ i) scanf("%lld", &A[i]);
	int ans = 1e18, res = 0;
	dp[0] = 0;
	int cur = 0, cnt = 1000;
	dp[1] = A[1] + T;
	for(int i = 2; i <= n; ++ i) {
		dp[i] = 1e18;
		//for(int j = 0; j < i; ++ j)
		while(cur + 1 < i && calc(cur, i) >= calc(cur + 1, i)) ++ cur;
		bool ok = 0;
		while(1) {
			int t = cur;
			for(int j = t; j < i && j < t + 1000; ++ j) {
				if(calc(j, i) < calc(cur, i)) cur = j;
			}
			if(cur == t) break;
			else ok = 1;
		}
		if(n >= 1e4 && cnt) {
			-- cnt;
		while(1) {
			int t = cur;
			for(int j = t; j < i && j < t + 100000; ++ j) {
				if(calc(j, i) < calc(cur, i)) cur = j;
			}
			if(cur == t) break;
			else ok = 1;
		}			
		}
		dp[i] = min(calc(cur, i), dp[i]);
	}
	cout << dp[n] + E - A[n] << endl;
}