#include<iostream>
using namespace std;
int n,e,t,x[200000];
long long dp[200000];
int main()
{
	cin>>n>>e>>t;
	for(int i=1;i<=n;i++)cin>>x[i];
	for(long long i=1,j=0,buf=1ll<<40;i<=n;i++)
	{
		while(t<(x[i]-x[j+1])*2)
		{
			buf=min(buf,dp[j]-x[j]-x[j+1]*2);
			j++;
		}
		dp[i]=min(buf+x[i]*3ll,dp[j]+x[i]-x[j]+t);
		//for(int j=0;j<i;j++)dp[i]=min(dp[i],dp[j]+x[i]-x[j]+max(t,(x[i]-x[j+1])<<1));
	}
	cout<<dp[n]+e-x[n]<<endl;
	return 0;
}
