#include <bits/stdc++.h>
using namespace std;
const int maxn = 200200;
long long f[maxn], x[maxn];
int main(){
	int n, E, T;
	cin >> n >> E >> T;
	for(int i = 1; i <= n; i++) cin >> x[i];
	multiset<long long> small, bigger;
	int j = 1;
	for(int i = 1; i <= n; i++){
		while(j < i && 2*(x[i] - x[j]) > T){
			small.erase(small.find(f[j - 1]));
			bigger.insert(f[j - 1] - 2 * x[j]);
			j++;
		}
		f[i] = T + f[i - 1];
		if(!small.empty()) f[i] = min(f[i], *small.begin() + T);
		if(!bigger.empty()) f[i] = min(f[i], *bigger.begin() + 2 * x[i]);
		small.insert(f[i - 1]);
	}
	cout << f[n] + E << endl;
	return 0;
}
