#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int MaxN = 100003;
LL dp[MaxN];
int n,e,t,x[MaxN];
int main() {
	scanf("%d%d%d",&n,&e,&t);
	for (int i=1;i<=n;i++) scanf("%d",x+i);
	int ptr=1;
	LL mn=0x7fffffff;
	dp[0]=0;
	for (int i=1;i<=n;i++) {
		while (ptr<=n && 2*(x[i]-x[ptr])>t) {
			mn=min(mn,dp[ptr-1]-x[ptr]*2);
			ptr++;
		}
		dp[i]=min(dp[ptr-1]+t,mn+x[i]*2);
	}
	printf("%lld\n",e+dp[n]);
    return 0;
}