//Δ
#include<iostream>
#include<cstdio>
#include<fstream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<cmath>
#include<cstring>
#include<cstdlib>
using namespace std;
typedef long long LL;
const int N = 1e5+15;
const LL inf = 1e18+N;
int n,e,t,a[N];
LL dp[N];
int main()
{
	int i,x;
	LL y,z;
	scanf("%d%d%d",&n,&e,&t);
	for(i=1;i<=n;i=i+1)
		scanf("%d",a+i);
	a[0]=0,a[n+1]=e;
	dp[1]=0;
	x=1;
	y=inf;
	for(i=1;i<=n;i=i+1){
		while(2*(a[i]-a[x])>t){
			y=min(y,dp[x]-2*a[x]);
			x++;
		}
		dp[i+1]=min(dp[x]+t,y+2*a[i]);
		//cout<<i+1<<' '<<x<<' '<<dp[i+1]<<endl;
	}
	cout<<dp[n+1]+e<<endl;
	return 0;
}
/*
2 1000000000 1000000000
1 999999999
*/