import sys


def solve(n, e, t, xxx):
    if n == 1:
        return e + t

    ans = xxx[0] + (e - xxx[-1])

    i = 0
    while i < n:
        for j in range(i, n - 1):
            dx0 = xxx[j] - xxx[i]
            dx1 = xxx[j + 1] - xxx[i]
            stop = max(2 * dx0, t) + dx0 + xxx[j + 1] - xxx[j] + t
            through = max(2 * dx1, t) + dx1
            if stop < through:
                ans += stop - t
                i = j + 1
                break
        else:
            dx1 = xxx[n - 1] - xxx[i]
            ans += max(2 * dx1, t) + dx1
            i = n

    return ans


n, e, t, *xxx = map(int, sys.stdin.buffer.read().split())
print(solve(n, e, t, xxx))
