#include <bits/stdc++.h>
using namespace std;
const int MN = 100010;
int N, E, T;
int X[MN];
struct BIT {
  vector<long long> tree;
  void init() { tree = vector<long long>(4 * MN, 1e18); }
  void upd(int idx, long long val, int l, int r, int n) {
    if (idx < l || r < idx) return;
    if (l == r) {
      tree[n] = min(tree[n], val);
      return;
    }
    int m = (l + r) >> 1;
    upd(idx, val, l, m, 2 * n);
    upd(idx, val, m + 1, r, 2 * n + 1);
    tree[n] = min(tree[2 * n], tree[2 * n + 1]);
  }
  long long quer(int a, int b, int l, int r, int n) {
    if (b < l || r < a) return 1e18;
    if (a <= l && r <= b) return tree[n];
    int m = (l + r) >> 1;
    long long L = quer(a, b, l, m, 2 * n);
    long long R = quer(a, b, m + 1, r, 2 * n + 1);
    return min(L, R);
  }
} bit1, bit2;
long long dp[MN];
int main() {
  scanf("%d %d %d", &N, &E, &T);
  for (int i = 0; i < N; i++) {
    scanf("%d", &X[i]);
  }
  X[N] = E;
  bit1.init();
  bit2.init();
  dp[N] = 0;
  bit1.upd(N, dp[N] + 2 * X[N - 1] + X[N], 0, MN - 1, 1);
  bit2.upd(N, dp[N] + X[N], 0, MN - 1, 1);
  for (int i = N - 1; i >= 0; i--) {
    int s = i + 1, e = N, p = -1;
    while (s <= e) {
      int m = (s + e) >> 1;
      if (T > 2 * (X[m - 1] - X[i])) {
        p = m;
        s = m + 1;
      } else
        e = m - 1;
    }
    dp[i] = bit1.quer(p + 1, N, 0, MN - 1, 1) - 3 * X[i];
    dp[i] = min(dp[i], bit2.quer(i + 1, p, 0, MN - 1, 1) - X[i] + T);
    bit1.upd(i, dp[i] + 2 * (i ? X[i - 1] : 0) + X[i], 0, MN - 1, 1);
    bit2.upd(i, dp[i] + X[i], 0, MN - 1, 1);
  }
  printf("%lld", dp[0] + X[0]);
}
