#include <iostream>
#include <algorithm>
using namespace std;
int n,t,e,a[100005];
long long f[100005];
int main(){
	cin>>n>>e>>t;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	long long cur=1e18;
	for(int i=1,l=1;i<=n;i++){
		while(2*(a[i]-a[l])>=t){
			cur=min(cur,f[l-1]-2*a[l]);
			l++;
		}
		f[i]=min(f[l-1]+t,cur+2*a[i]);
	}
	cout<<f[n]+e<<endl;
	return 0;
}