#include <bits/stdc++.h>
using namespace std;
struct segtree {
  long long int M = 1, INIT;
  vector<long long int> dat;
  segtree(long long int N, long long int num) {
    INIT = num;
    while (M < N) M *= 2;
    for (int i = 0; i < M * 2 - 1; i++) dat.push_back(num);
  }
  void update(long long int x, long long int k, long long int l = 0,
              int r = -1) {
    if (r == -1) r = M;
    k += M - 1;
    dat[k] = x;
    while (k > 0) k = (k - 1) / 2, dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);
  }
  long long int query(long long int a, long long int b = -1,
                      long long int k = 0, long long int l = 0,
                      long long int r = -1) {
    if (r == -1) r = M;
    if (b == -1) b = M;
    if (r <= a || b <= l) return INIT;
    if (a <= l && r <= b) return dat[k];
    long long int A = query(a, b, k * 2 + 1, l, (l + r) / 2);
    long long int B = query(a, b, k * 2 + 2, (l + r) / 2, r);
    return min(A, B);
  }
};
int main(int argc, char const *argv[]) {
  long long int n, e, t;
  std::cin >> n >> e >> t;
  if (n > 2000) throw runtime_error("error");
  vector<long long int> x(n + 1, -10000000000);
  for (long long int i = 0; i < n; i++) scanf("%lld", &x[i + 1]);
  long long int INF = 1000000000000000000;
  vector<long long int> dp(n + 1, INF);
  dp[0] = e;
  segtree seg(n + 1, INF);
  seg.update(dp[0] - 2 * x[1], 0);
  for (int now = 1; now <= n; now++) {
    long long int l =
        lower_bound((x).begin(), (x).end(), x[now] - t / 2) - x.begin();
    if (now != 1) {
      dp[now] = dp[l - 1] + t;
      dp[now] = min(dp[now], 2 * x[now] + seg.query(0, l - 1));
    } else {
      dp[now] = dp[0] + t;
    }
    if (now != n) seg.update(dp[now] - 2 * x[now], now);
  }
  std::cout << dp[n] << '\n';
  return 0;
}
