#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const long long inf = 1LL << 61;
struct sgt {
  long long mn[maxn * 2];
  int id(int l, int r) { return l + r | l != r; }
  void build(int l, int r) {
    mn[id(l, r)] = inf;
    if (l == r) return;
    int mid = (l + r) >> 1;
    build(l, mid);
    build(mid + 1, r);
  }
  long long Q(int l, int r, int l0, int r0) {
    if (l0 <= l && r0 >= r) return mn[id(l, r)];
    int mid = (l + r) >> 1;
    long long ans = inf;
    if (l0 <= mid) ans = min(ans, Q(l, mid, l0, r0));
    if (r0 > mid) ans = min(ans, Q(mid + 1, r, l0, r0));
    return ans;
  }
  void C(int l, int r, int ps, long long val) {
    if (l == r) {
      mn[id(l, r)] = val;
      return;
    }
    int mid = (l + r) >> 1;
    if (ps <= mid)
      C(l, mid, ps, val);
    else
      C(mid + 1, r, ps, val);
    mn[id(l, r)] = min(mn[id(l, mid)], mn[id(mid + 1, r)]);
  }
} T1, T2;
int n;
long long T, E;
long long d[maxn];
long long dp[maxn], d2[maxn];
long long bf() {
  dp[1] = 0;
  for (int i = 2; i <= n; i++) {
    dp[i] = inf;
    for (int j = 1; j <= i; j++) {
      dp[i] =
          min(dp[i], dp[j - 1] + d[i] - d[j - 1] + max(T, 2 * (d[i] - d[j])));
    }
    printf("dp[%d]=%lld\n", i, dp[i]);
  }
  long long ans = dp[n] + E - d[n];
  return ans;
}
int main() {
  scanf("%d%lld%lld", &n, &E, &T);
  n++;
  d[1] = 0;
  for (int i = 2; i <= n; i++) {
    scanf("%lld", &d[i]);
    d2[i] = d[i] * 2;
  }
  T1.build(1, n);
  T2.build(1, n);
  dp[1] = 0;
  T1.C(1, n, 1, 0);
  T2.C(1, n, 1, 0);
  for (int i = 2; i <= n; i++) {
    int ps = 0;
    dp[i] = dp[i - 1] + d[i] - d[i - 1] + T;
    for (int j = 1; j < i; j++) {
      if (2 * (d[i] - d[j]) >= T) {
        ps = j;
      } else {
        break;
      }
    }
    long long res1 = inf, res2 = inf;
    if (ps >= 1) res1 = T1.Q(1, n, 1, ps) + 3 * d[i];
    if (ps + 1 <= i - 1) res2 = T2.Q(1, n, ps + 1, i - 1) + d[i] + T;
    dp[i] = min(dp[i], res1);
    dp[i] = min(dp[i], res2);
    T1.C(1, n, i, dp[i - 1] - d[i - 1] - 2 * d[i]);
    T2.C(1, n, i, dp[i - 1] - d[i - 1]);
  }
  long long ans = dp[n] + E - d[n];
  cout << ans << endl;
  return 0;
}
