#include<bits/stdc++.h>
using namespace std;
long long n,m,t,x[100005],dp[100005];
multiset<long long>s;
int main()
{
	scanf("%lld%lld%lld",&n,&m,&t);
	for(long long i=1;i<=n;i++)scanf("%lld",&x[i]);
	dp[0]=0;
	long long mn=1e18,pos=1;
	for(long long i=1;i<=n;i++)
	{
		s.insert(dp[i-1]);
		while(pos<=i&&2*(x[i]-x[pos])>t)
		{
			mn=min(mn,dp[pos-1]-2*x[pos]);
			s.erase(s.find(dp[pos-1]));
			pos++;
		}
		dp[i]=min(*s.begin()+t,mn+2*x[i]);
	}
	printf("%lld\n",dp[n]+m);
	return 0;
} 