// <<<<GOD>>>> lET'S gO

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

typedef long long ll;
const ll N = 1e5 + 100, inF = 1e15;

ll n, e, t, mini = inF, a[N], dp[N];

int main() {
	ios::sync_with_stdio(false), cin.tie(0);
	cin >> n >> e >> t;
	for (int i = 1; i <= n; i++)
		cin >> a[i];
	int p = 0;
	for (int i = 1; i <= n; i++) {
		while(2 * (a[i] - a[p]) > t) {
			mini = min(mini, dp[p - 1] - 2 * a[p]);
			p++;
		}
		dp[i] = dp[p - 1] + t;
		dp[i] = min(dp[i], 2 * a[i] + mini);
	}
	cout << e + dp[n];
	return 0;
}