#include<iostream>
#include<cstdio>
#include<set>
using namespace std;
long long n,t,e,x[111111],mnp,pos,dp[111111];
multiset<long long> s;
int main()
{
	scanf("%lld%lld%lld",&n,&e,&t);
	for (long long i=1;i<=n;i++)
	{
		scanf("%lld",&x[i]);
	}
	dp[0]=0;
	mnp=1e18;
	pos=1;
	for (long long i=1;i<=n;i++)
	{
		s.insert(dp[i-1]);
		while(pos<=i)
		{
			if (2*(x[i]-x[pos])>t) 
			{
				mnp=min(mnp,dp[pos-1]-2*x[pos]);
				s.erase(s.find(dp[pos-1]));
				pos++;
			}
			else break;
		}
		dp[i]=min(*s.begin()+t,mnp+2*x[i]);
	}
	printf("%lld\n",dp[n]+e);
	return 0;
} 