#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100005;
template <typename V>
class segtree {
 private:
  int n, sz;
  vector<V> node, lazy;
  vector<bool> lazyFlag;

 public:
  segtree(vector<V> v) {
    sz = (int)v.size();
    n = 1;
    while (n < sz) n *= 2;
    node.resize(2 * n - 1);
    lazy.resize(2 * n - 1, 0);
    lazyFlag.resize(2 * n - 1, false);
    for (int i = 0; i < (int)(sz); ++i) node[i + n - 1] = v[i];
    for (int i = n - 2; i >= 0; i--)
      node[i] = min(node[i * 2 + 1], node[i * 2 + 2]);
  }
  void eval(int k, int l, int r) {
    if (lazyFlag[k]) {
      node[k] = lazy[k];
      if (r - l > 1) {
        lazy[k * 2 + 1] = lazy[k * 2 + 2] = lazy[k];
        lazyFlag[k * 2 + 1] = lazyFlag[k * 2 + 2] = true;
      }
      lazyFlag[k] = false;
    }
  }
  void range(int a, int b, V x, int k = 0, int l = 0, int r = -1) {
    if (r < 0) r = n;
    eval(k, l, r);
    if (b <= l || r <= a) return;
    if (a <= l && r <= b) {
      lazy[k] = x;
      lazyFlag[k] = true;
      eval(k, l, r);
    } else {
      range(a, b, x, 2 * k + 1, l, (l + r) / 2);
      range(a, b, x, 2 * k + 2, (l + r) / 2, r);
      node[k] = min(node[2 * k + 1], node[2 * k + 2]);
    }
  }
  V query(int a, int b, int k = 0, int l = 0, int r = -1) {
    if (r < 0) r = n;
    eval(k, l, r);
    if (b <= l || r <= a) return LLONG_MAX;
    if (a <= l && r <= b) return node[k];
    V vector<long long> = query(a, b, 2 * k + 1, l, (l + r) / 2),
                  vr = query(a, b, 2 * k + 2, (l + r) / 2, r);
    return min(vector<long long>, vr);
  }
  void print() {
    for (int i = 0; i < (int)(sz); ++i) cout << query(i, i + 1) << " ";
    cout << endl;
  }
};
long long dp[MAX_N];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, E, T;
  cin >> n >> E >> T;
  vector<long long> vec(n);
  for (int i = 0; i < (int)(n); ++i) {
    cin >> vec[i];
  }
  segtree<long long> st(vector<long long>(n, 0));
  dp[0] = 0;
  st.range(0, 1, -2 * vec[0]);
  for (int i = 0; i < (int)(n); ++i) {
    int id =
        lower_bound((vec).begin(), (vec).end(), vec[i] - T / 2) - vec.begin();
    if (id == 0) {
      dp[i + 1] = dp[id] + T;
      if (i < n - 1) {
        st.range(i + 1, i + 2, dp[i + 1] - 2 * vec[i + 1]);
      }
      continue;
    } else if (id <= i) {
      dp[i + 1] = dp[id] + T;
    }
    if (i == 0) {
      dp[i + 1] = min(dp[i + 1], 2 * vec[i]);
    } else {
      dp[i + 1] = min(dp[i + 1], st.query(0, i) + 2 * vec[i]);
    }
    if (i < n - 1) {
      st.range(i + 1, i + 2, dp[i + 1] - 2 * vec[i + 1]);
    }
  }
  cout << dp[n] + E << "\n";
  return 0;
}
