from sys import stdin
from itertools import repeat
def main():
    n, e, t = map(int, stdin.readline().split())
    x = [0] + map(int, stdin.readline().split(), repeat(10, n)) + [e]
    dp = [0] * (n + 1)
    f = [0] * (n + 1)
    f[0] = -x[1] * 2
    j = 0
    for i in xrange(1, n + 1):
        while j < i - 1 and (x[i] - x[j+1]) * 2 > t:
            j += 1
        dp[i] = dp[j] + t
        if j > 0 and dp[i] > f[j-1] + x[i] * 2:
            dp[i] = f[j-1] + x[i] * 2
        f[i] = dp[i] - x[i+1] * 2
        if i and f[i] > f[i-1]:
            f[i] = f[i-1]
    print dp[n] + e
main()
