n,e,t=map(int,raw_input().split())
x=[0]+map(int,raw_input().split())
dp1=[0]*(n+1)
dp1[n]=e-x[n]
dp2=[0]*(n+1)
dp2[n]=t+e-x[n]
for i in reversed(range(n)):
    dp1[i]=x[i+1]-x[i]+dp2[i+1]
    u=[max(t,(x[j]-x[i])*2)+x[j]-x[i]+dp1[j] for j in range(i,n+1)]
    dp2[i]=min(u)
print dp1[0]
