#include<iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<algorithm>
#define min(a,b) ((a)<(b)?(a):(b))
using namespace std;
int n,m,t,x[100010];
long long f[100010];
int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	int i,j;
	long long k;
	scanf("%d%d%d",&n,&m,&t);
	for(i=1;i<=n;i++)
	  scanf("%d",&x[i]);
	for(i=1,j=0,k=1e18;i<=n;i++)
	  {
	   for(;2*(x[i]-x[j+1])>t;j++)
	     k=min(k,f[j]-2*x[j+1]);
	   f[i]=min(k+2*x[i],f[j]+t);
      }
    cout<<f[n]+m<<"\n";
	return 0;
}
