#include <bits/stdc++.h>
using namespace std;
template <typename T>
class segtree {
 public:
  int n;
  vector<T> dat;
  T ZERO;
  segtree(int n_, T zero) : ZERO(zero) {
    n = 1;
    while (n < n_) n *= 2;
    dat.resize(2 * n);
    for (int i = 0; i < 2 * n; i++) dat[i] = ZERO;
  }
  void update(int k, int a) {
    k += n - 1;
    dat[k] = a;
    while (k > 0) {
      k = (k - 1) / 2;
      dat[k] = function(dat[k * 2 + 1], dat[k * 2 + 2]);
    }
  }
  T function(T a, T b) { return min(a, b); }
  T get(int k) { return dat[k + n - 1]; }
  T que(int a, int b) {
    T L = ZERO, R = ZERO;
    int A = a + n - 1;
    int B = b + n - 1;
    while (A < B) {
      if ((A & 1) == 0) L = function(L, dat[A++]);
      if ((B & 1) == 0) R = function(R, dat[--B]);
      A = A >> 1;
      B = B >> 1;
    }
    return function(L, R);
  }
};
int main() {
  long long n, e, t;
  cin >> n >> e >> t;
  vector<long long> v(n + 10);
  vector<long long> x(n + 10);
  vector<long long> sum_x(n + 10);
  for (long long(i) = (0); (i) < (n); ++i) {
    cin >> v[i + 1];
    x[i + 1] = v[i + 1] - v[i];
    sum_x[i + 1] = x[i + 1];
  }
  for (long long(i) = (0); (i) < (n); ++i) sum_x[i + 1] += sum_x[i];
  segtree<long long> sg1(n + 10, 1000000000000000000LL);
  sg1.update(1, x[1] - 3 * sum_x[1]);
  segtree<long long> sg2(n + 10, 1000000000000000000LL);
  sg2.update(1, x[1] - sum_x[1]);
  long long seica = 1;
  long long ans;
  for (int i = 2; i <= n + 1; i++) {
    while (seica < i - 1 && t - 2 * (sum_x[i - 1] - sum_x[seica - 1]) <= 0)
      seica++;
    long long A = 3 * sum_x[i - 1] + sg1.que(1, seica);
    long long B = t + sum_x[i - 1] + sg2.que(seica, i);
    long long now = min(A, B);
    if (i != n + 1) {
      sg1.update(i, now + x[i] - 3 * sum_x[i]);
      sg2.update(i, now + x[i] - sum_x[i]);
    } else {
      ans = now;
    }
  }
  cout << ans + e - v[n] << endl;
  return 0;
}
