import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;

class A{
	ulong s, w;
	this(ulong s, ulong w){
		this.s = s;
		this.w = w;
		}
	A son1(ulong t, ulong x){
		debug writeln("1", [s, w, t, x]);
		if(w < x + x){
			if(t < x + x) return new A(s - w + x + x + x, 0);
			else return new A(s - w + x + t, t - x - x);
			}
		else return new A(s - w + x + t, t - w);
		}
	A son2(ulong t, ulong x){
		debug writeln("2", [s, w, t, x]);
		return new A(s + x + t, t);
		}
	string toString(){
		return "(" ~ s.to!string ~ "," ~ w.to!string ~ ")";
		}
	}

void main(){
	int n, t, e;
	{
		int[] tmp = readln.chomp.split.map!(to!int).array;
		n = tmp[0], e = tmp[1], t = tmp[2];
		}
	
	int[] xs = readln.chomp.split.map!(to!int).array;
	int[] ys = [xs[0]];
	foreach(i; 1 .. n) ys ~= xs[i] - xs[i - 1];
	
	A[] as = [new A(0, 0)];
	foreach(y; ys){
		A[] tmpas;
		foreach(a; as){
			tmpas ~= a.son1(t, y);
			tmpas ~= a.son2(t, y);
			}
		as = [];
		tmpas.sort!("a.s < b.s")();
		ulong maxw = 0;
		foreach(a; tmpas){
			if(a.w >= maxw){
				as ~= a;
				maxw = a.w;
				}
			}
		debug tmpas.writeln;
		debug as.writeln;
		}
	
	
	ulong mins = ulong.max;
	foreach(a; as) if(a.s < mins) mins = a.s;
	
	ulong ans = mins + (e - xs[$ - 1]);
	ans.writeln;
	}