#include<bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, T, E, A[N];
long long dp[N];
int main()
{
    scanf("%d%d%d", &n, &E, &T);
    for (int i = 1; i <= n; i++)
        scanf("%d", &A[i]);
    int r = 1;
    long long Mn = 1e18;
    for (int i = 1; i <= n; i++)
    {
        while ((A[i] - A[r]) * 2 >= T)
            Mn = min(Mn, dp[r - 1] - A[r] * 2), r ++;
        dp[i] = min(dp[r - 1] + T, Mn + A[i] * 2);
    }
    return !printf("%lld\n", dp[n] + E);
}