#include <bits/stdc++.h>
using namespace std;
inline void Fail() {
  printf("0");
  exit(0);
}
const int maxn = 100005;
int n, e, t;
long long dp[maxn];
int x[maxn], y[maxn];
class segtree {
 public:
  long long tree[maxn * 4];
  int leaf[maxn];
  void build(int l, int r, int node) {
    if (l == r) {
      leaf[l] = node;
      tree[node] = 1e18;
      return;
    }
    int mid = (l + r) >> 1;
    build(l, mid, node * 2);
    build(mid + 1, r, node * 2 + 1);
  }
  void upd(int node, long long val) {
    node = leaf[node];
    tree[node] = val;
    node >>= 1;
    while (node) {
      tree[node] = min(tree[node * 2], tree[node * 2 + 1]);
      node >>= 1;
    }
  }
  long long query(int l, int r, int vl, int vr, int node) {
    if (r < l || vr < vl) return 1e18;
    if (l > vr || r < vl) return 1e18;
    if (l >= vl && r <= vr) return tree[node];
    int mid = (l + r) >> 1;
    return min(query(l, mid, vl, vr, node * 2),
               query(mid + 1, r, vl, vr, node * 2 + 1));
  }
} t1, t2;
int main() {
  scanf("%d%d%d", &n, &e, &t);
  for (int(i) = 0; (i) < n; i++) scanf("%d", &x[i]), y[i] = 2 * x[i];
  t1.build(0, n - 1, 1);
  t2.build(0, n - 1, 1);
  for (int(i) = 0; (i) < n; i++) {
    dp[i] = max((x[i] - x[0]) * 2LL, 1LL * t);
    int pos = lower_bound(y, y + n, 2 * x[i] - t) - y;
    dp[i] = min(dp[i], min(t1.query(0, n - 1, 0, pos - 2, 1) + 2LL * x[i],
                           t2.query(0, n - 1, pos - 1, n - 1, 1) + t));
    t1.upd(i, dp[i] - 2LL * x[i + 1]);
    t2.upd(i, dp[i]);
  }
  printf("%lld", e + dp[n - 1]);
  return 0;
}
