#include <algorithm>
#include <cassert>
#include <cstring>
#include <iostream>
#include <set>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define TRACE(x) cout << #x << " = " << x << endl
#define _ << " _ " <<

typedef long long llint;

const int MAX = 100100;
const llint inf = 1e18;

int x[MAX];
llint f[MAX];

int main(void) {
  int N, E, T;
  scanf("%d %d %d", &N, &E, &T);
  REP(i, N) scanf("%d", &x[i]);
  
  f[0] = 0;
  multiset<llint> S2;
  S2.insert(f[0]);
  
  int j = 0;
  llint best = inf;
  for (int i = 1; i <= N; ++i) {
    while (2*(x[i-1] - x[j]) > T) {
      S2.erase(S2.find(f[j]));
      best = min(best, f[j] - 2*x[j]);
      j++;
    }

    f[i] = min(best + 2*x[i-1], *S2.begin() + T);
    S2.insert(f[i]);
  }

  llint ans = E + f[N];
  //printf("%lld\n", ans);
  cout << ans << endl;
  return 0;
}
