# include <iostream>
# include <cmath>
# include <algorithm>
# include <stdio.h>
# include <cstdint>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <random>
# include <deque>
# include <functional>
# include <iomanip>
# include <sstream>
# include <fstream>
# include <complex>
# include <numeric>
# include <immintrin.h>
# include <cassert>
# include <array>
# include <tuple>
# include <unordered_map>
# include <unordered_set>
# include <thread>

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using ui32 = unsigned int;
constexpr ll INFLL = 1e18;

#define CHECK_IMPL1(cond)              \
if (!(cond)) {                         \
    DEBUG("expected cond: " << #cond); \
    assert(cond);                      \
}

#define CHECK_IMPL2(cond, message)                                            \
if (!(cond)) {                                                                \
    DEBUG("expected cond: " << #cond << " failed with message: " << message); \
    assert(cond);                                                             \
}
#define CHECK_IMPL(_1, _2, NAME, ...) NAME
#define CHECK(...) CHECK_IMPL(__VA_ARGS__, CHECK_IMPL2, CHECK_IMPL1, CHECK_IMPL0)(__VA_ARGS__)

#ifdef __APPLE__
#define DEBUG(message) std::cerr << message << std::endl;
#else
#define DEBUG(message)
#endif

class SegmentTree {
 public:
  SegmentTree(int n) : n_(n), tree_(5 * n + 1, INFLL) {
  }

  void update(int pos, ll value) {
    update_impl(pos, value, 1, 0, n_);
  }

  ll get(int l, int r) {
    return get_impl(l, r, 1, 0, n_);
  }

 private:
  void update_impl(int pos, ll value, int v, int l, int r) {
    if (l == r) {
      tree_[v] = value;
    } else {
      int m = (l + r) / 2;
      if (pos <= m) {
        update_impl(pos, value, v * 2, l, m);
      } else {
        update_impl(pos, value, v * 2 + 1, m + 1, r);
      }
      tree_[v] = min(tree_[v * 2], tree_[v * 2 + 1]);
    }
  }

  ll get_impl(int l, int r, int tv, int tl, int tr) {
    if (r < tl || l > tr) {
      return INFLL;
    }
    if (l == tl && r == tr) {
      return tree_[tv];
    }
    int tm = (tl + tr) / 2;
    return min(get_impl(l, min(tm, r), tv * 2, tl, tm), get_impl(max(tm + 1, l), r, tv * 2 + 1, tm + 1, tr));
  }

 private:
  int n_;
  vector<ll> tree_;
};

void solve() {
  int n;
  ll e, t;
  cin >> n >> e >> t;

  vector<ll> x(n + 1, 0);
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
  }

  vector<ll> dp(n + 1, INFLL);
  dp[0] = 0;

  SegmentTree first_case(n);
  SegmentTree second_case(n);

  first_case.update(0, 0 - 2 * x[1] - x[0]);
  second_case.update(0, 0 - x[0]);

  for (int i = 1; i <= n; i++) {
//    cout << endl << endl << "iter: " << i << endl;
    int k = lower_bound(x.begin(), x.end(), (2 * x[i] - t) / 2) - x.begin();
    k = max(0, k - 1);
    if (k > i - 1) {
      k = i - 1;
    }
    while (k < i - 1 && t - 2 * (x[i] - x[k + 1]) < 0) {
      ++k;
    }
//    cout << (2 * x[i] - t) / 2 << endl;

    // 1) dp[i] = min(dp[i], dp[j] + 3 * x[i] - 2 * x[j + 1] - x[j]);
    // 2) dp[i] = min(dp[i], dp[j] + x[i] + t - x[j]);

//    cout << k << " first: " << first_case.get(0, k) << " second: " << second_case.get(k + 1, i - 1) << endl;
//
//    cout << "1) " << first_case.get(0, k - 1) << endl;
//    cout << "2) " << second_case.get(k, i - 1) << endl;

    CHECK(t - 2 * (x[i] - x[k + 1]) >= 0);

    dp[i] = min(dp[i], first_case.get(0, k - 1) + 3 * x[i]);
    dp[i] = min(dp[i], second_case.get(k, i - 1) + x[i] + t);

    if (i < n) {
      first_case.update(i, dp[i] - 2 * x[i + 1] - x[i]);
      second_case.update(i, dp[i] - x[i]);
    }

//    for (int j = 0; j < i; j++) {
//      dp[i] = min(dp[i], dp[j] + (x[i] - x[j + 1]) * 3 + max(0ll, t - 2 * (x[i] - x[j + 1])) + x[j + 1] - x[j]);
//    }

//    cout << i << " " << dp[i] << endl;
  }

  cout << dp[n] + e - x[n] << "\n";
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
#ifdef __APPLE__
  freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
#endif
  int t = 1;
//  cin >> t;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}

Measured memory_bytes: 9600