#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
#include <map>
#include <set>
#include <cmath>
#include <vector>
#include <ctime>
#include <Queue>
#include <sstream>
#include <utility>
#include <bitset>
#include <stack>

using namespace std;

#define MP make_pair 
#define PB push_back 
#define INF (1000000007) 
#define eps 1e-8
#define MOD (1000003)
#define IOS ios::sync_with_stdio(false)

typedef pair<int,int> pii ;
typedef pair<double,double> pdd ;
typedef long long ll ;

ll n,e,t;
ll dp[100005],p[100005];
ll mx=1e18;
multiset<ll>s;

int main()
{
	IOS;
	cin>>n>>e>>t;
	for(int i=1;i<=n;i++) cin>>p[i];
	dp[0]=0;
	int pos=0;
	for(int i=1;i<=n;i++)
	{
		s.insert(dp[i-1]);
		while(pos<=i)
		{
			if((p[i]-p[pos])*2>t) 
			{
				mx=min(dp[pos-1]-p[pos]*2,mx);
				s.erase(dp[pos-1]);
				pos++;
			}
			else break;
		}
		dp[i]=min(*s.begin()+t,mx+2*p[i]);
	}
	cout<<dp[n]+e;
	return 0;
}