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

#define FOR(i,l,r) for(int i = (l);i < (r);i++)
#define ALL(x) (x).begin(),(x).end()
template<typename T> bool chmax(T& a,const T& b){return a < b ? (a = b,true) : false;}
template<typename T> bool chmin(T& a,const T& b){return b < a ? (a = b,true) : false;}
typedef long long ll;

ll N,E,T;
ll dp1 [100001];
ll dp2 [100001];
const ll INF = 1e17;

int main()
{
	scanf("%lld%lld%lld",&N,&E,&T);
	vector<ll> X(N + 1);
	for(int i = 1;i <= N;i++){
		scanf("%lld",&X [i]);
	}

	fill_n(dp1,N + 1,INF);
	fill_n(dp2,N + 1,INF);
	dp1 [0] = 0;

	int j = 1;
	for(int i = 1;i <= N;i++){
		while(j < i && (X [i] - X [j]) * 2 > T) j++;
		chmin(dp1 [i],dp1 [j - 1] + T);
		chmin(dp1 [i],dp2 [j - 1] + X [i] * 2);
		chmin(dp2 [i],min(dp2 [i - 1],dp1 [i - 1] - X [i] * 2));
	}

	printf("%lld\n",dp1 [N] + E);

	return 0;
}
