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