from sys import stdin
from itertools import repeat
def main():
    n, e, t = map(int, stdin.readline().split())
    x = map(int, stdin.readline().split(), repeat(10, n))
    x.append(e)
    i = 0
    ans = x[0]
    while i < n:
        j = i + 1
        while j < n and x[j] - x[i] <= t:
            j += 1
        ans += x[j] - x[i] + max(t, (x[j-1] - x[i]) * 2)
        i = j
    print ans
main()
