#include <bits/stdc++.h>
int n, e, t, x[100005];
long long dp[100005];
namespace SegTree {
long long mn[100005 << 2];
void init() { memset(mn, 0x3f, sizeof mn); }
void modify(int k, int l, int r, int pos, long long val) {
  if (l == r) {
    mn[k] = val;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    modify(k << 1, l, mid, pos, val);
  else
    modify(k << 1 | 1, mid + 1, r, pos, val);
  mn[k] = std::min(mn[k << 1], mn[k << 1 | 1]);
}
long long query(int k, int l, int r, int L, int R) {
  if (L > R) return 0x3f3f3f3f3f3f3f3fll;
  if (L <= l && r <= R) return mn[k];
  int mid = (l + r) >> 1;
  long long res = 0x3f3f3f3f3f3f3f3fll;
  if (L <= mid) res = std::min(res, query(k << 1, l, mid, L, R));
  if (mid < R) res = std::min(res, query(k << 1 | 1, mid + 1, r, L, R));
  return res;
}
}  // namespace SegTree
int main() {
  scanf("%d%d%d", &n, &e, &t);
  for (int i = 1; i <= n; ++i) scanf("%d", x + i);
  SegTree::init();
  int l = 1;
  dp[1] = t;
  SegTree::modify(1, 1, n, 1, dp[1]);
  for (int i = 2; i <= n; ++i) {
    while ((x[i] - x[l + 1]) * 2 >= t) {
      SegTree::modify(1, 1, n, l, dp[l] - x[l + 1] * 2);
      ++l;
    }
    dp[i] = std::min(t + SegTree::query(1, 1, n, l, i - 1),
                     x[i] * 2 + SegTree::query(1, 1, n, 1, l - 1));
    SegTree::modify(1, 1, n, i, dp[i]);
  }
  printf("%lld\n", dp[n] + e);
  return 0;
}
