#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const long long linf = 0x3f3f3f3f3f3f3f3f;
inline void chk_min(long long &a, long long b) {
  if (a > b) a = b;
}
struct Queue {
  int q[MAXN], hd, tl;
  Queue(void) { hd = tl = 0; }
  inline bool empty(void) { return hd >= tl; }
  inline int front(void) { return q[hd + 1]; }
  inline int back(void) { return q[tl]; }
  inline void push(int x) { q[++tl] = x; }
  inline void pop_front(void) { ++hd; }
  inline void pop_back(void) { --tl; }
} q;
int a[MAXN];
long long dp[MAXN], preMn[MAXN];
int main(void) {
  int n, e, t;
  scanf("%d%d%d", &n, &e, &t);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  memset(dp, 0x3f, sizeof(dp));
  dp[1] = t;
  q.push(1);
  preMn[1] = dp[1] - 2 * a[2];
  for (int i = 2; i <= n; ++i) {
    while (!q.empty() && (a[i] - a[q.front() + 1]) * 2 > t) q.pop_front();
    dp[i] = dp[i - 1] + t;
    chk_min(dp[i], max(t, (a[i] - a[1]) * 2));
    if (!q.empty())
      chk_min(dp[i], dp[q.front()] + t),
          chk_min(dp[i], preMn[q.front() - 1] + 2 * a[i]);
    else
      chk_min(dp[i], preMn[i - 1] + 2 * a[i]);
    preMn[i] = min(preMn[i - 1], dp[i] - 2 * a[i + 1]);
    while (!q.empty() && dp[q.back()] >= dp[i]) q.pop_back();
    q.push(i);
  }
  printf("%lld\n", dp[n] + e);
  return 0;
}
