#include <bits/stdc++.h>
using namespace std;
inline int Max(int a, int b) { return (((b - a) >> (32 - 1)) & (a ^ b)) ^ b; }
inline int Min(int a, int b) { return (((b - a) >> (32 - 1)) & (a ^ b)) ^ a; }
int is_mul_overflow(long long a, long long b) { return LLONG_MAX / a < b; }
int x[100005];
long long dp[100005], a[4 * 100005], b[4 * 100005];
int n, e, t;
long long get(int a, int b) {
  long long d = x[b] - x[a];
  return t > 2LL * d ? t + d : 3LL * d;
}
void push_up(int rt) {
  a[rt] = min(a[rt << 1], a[rt << 1 | 1]);
  b[rt] = min(b[rt << 1], b[rt << 1 | 1]);
}
void build(int l, int r, int rt) {
  a[rt] = b[rt] = 10000000000000007;
  if (l == r) return;
  int mid = (l + r) >> 1;
  build(l, mid, rt << 1);
  build(mid + 1, r, rt << 1 | 1);
}
void update(int l, int r, int rt, int p, long long x, int f) {
  if (l == r) {
    if (f)
      a[rt] = min(a[rt], x);
    else
      b[rt] = min(b[rt], x);
    return;
  }
  int mid = (l + r) >> 1;
  if (p <= mid)
    update(l, mid, rt << 1, p, x, f);
  else
    update(mid + 1, r, rt << 1 | 1, p, x, f);
  push_up(rt);
}
long long query(int l, int r, int rt, int L, int R, int f) {
  if (L > R) return 10000000000000007;
  if (L <= l && R >= r) return f ? a[rt] : b[rt];
  int mid = (l + r) >> 1;
  long long ret = 10000000000000007;
  if (L <= mid) ret = min(ret, query(l, mid, rt << 1, L, min(mid, R), f));
  if (R > mid)
    ret = min(ret, query(mid + 1, r, rt << 1 | 1, max(L, mid + 1), R, f));
  return ret;
}
int get(int p) {
  int l = 0, r = p;
  while (l < r - 1) {
    int mid = (l + r) >> 1;
    if (2 * (x[p] - x[mid + 1]) >= t)
      l = mid;
    else
      r = mid;
  }
  return l;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  while (cin >> n >> e >> t) {
    for (int i = (1); i <= (n); i++) cin >> x[i];
    for (int i = (0); i <= (n); i++) dp[i] = 10000000000000007;
    build(1, n, 1);
    x[0] = 0;
    dp[0] = 0;
    int down = t % 2 ? (t + 1) / 2 : t / 2;
    for (int i = (1); i <= (n); i++) {
      int ps = get(i);
      dp[i] = min(dp[i], t + x[i] + query(1, n, 1, ps + 1, i - 1, 1));
      dp[i] = min(dp[i], 3 * x[i] + query(1, n, 1, 1, ps, 0));
      dp[i] = min(dp[i], x[1] - x[0] + get(1, i));
      update(1, n, 1, i, dp[i] - x[i], 1);
      update(1, n, 1, i, dp[i] - 2 * x[i + 1] - x[i], 0);
    }
    cout << dp[n] + e - x[n] << endl;
  }
  return 0;
}
