n,e,t=map(int,input().split())
a,f,l,c=[0]+list(map(int,input().split())),[0]*(n+1),1,int(1e18)
for i in range(1,n+1):
	while 2*(a[i]-a[l])>=t:
		c=min(c,f[l-1]-2*a[l])
		l+=1
	f[i]=min(f[l-1]+t,c+2*a[i])
print(f[n]+e)