#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
const long long inf = 2e12 + 7;
long long dp[N], dp1[4 * N], lazy[4 * N], pos[N];
void upd(long long idx, long long l, long long r, long long lef, long long rig,
         long long val) {
  if (l > rig || r < lef) {
    return;
  }
  if (l >= lef && r <= rig) {
    if (dp1[idx] <= val) {
      return;
    } else {
      if (dp1[idx] > val) {
        lazy[idx] = val;
        dp1[idx] = val;
      }
      return;
    }
  }
  if (lazy[idx] != inf) {
    dp1[2 * idx] = min(lazy[idx], dp1[2 * idx]);
    dp1[2 * idx + 1] = min(dp1[2 * idx + 1], lazy[idx]);
    lazy[2 * idx] = min(lazy[2 * idx], lazy[idx]);
    lazy[2 * idx + 1] = min(lazy[2 * idx + 1], lazy[idx]);
    lazy[idx] = inf;
  }
  upd(2 * idx, l, (l + r) / 2, lef, rig, val);
  upd(2 * idx + 1, (l + r) / 2 + 1, r, lef, rig, val);
  dp1[idx] = max(dp[2 * idx], dp[2 * idx + 1]);
}
long long getans(long long idx, long long l, long long r, long long pos1) {
  if (l > pos1 || r < pos1) {
    return inf;
  }
  if (l == r) {
    return dp1[idx];
  }
  if (lazy[idx] != inf) {
    dp1[2 * idx] = min(lazy[idx], dp1[2 * idx]);
    dp1[2 * idx + 1] = min(dp1[2 * idx + 1], lazy[idx]);
    lazy[2 * idx] = min(lazy[2 * idx], lazy[idx]);
    lazy[2 * idx + 1] = min(lazy[2 * idx + 1], lazy[idx]);
    lazy[idx] = inf;
  }
  return min(getans(2 * idx, l, (l + r) / 2, pos1),
             getans(2 * idx + 1, (l + r) / 2 + 1, r, pos1));
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, end, time, i, j, k;
  cin >> n >> end >> time;
  for (i = 1; i <= n; i++) {
    cin >> pos[i];
  }
  for (i = 1; i < N; i++) {
    dp[i] = inf;
  }
  for (i = 1; i < 4 * N; i++) {
    dp1[i] = inf;
  }
  for (i = 1; i < 4 * N; i++) {
    lazy[i] = inf;
  }
  for (i = 0; i < n; i++) {
    if (i != 0) {
      dp[i] = min(dp[i], getans(1, 1, n, i) + 3 * pos[i]);
    }
    k = upper_bound(pos + 1, pos + 1 + n, (time + 2 * pos[i + 1]) / 2) - pos -
        1;
    dp[k] = min(dp[k], dp[i] + time + pos[k] - pos[i]);
    if (k != n) {
      upd(1, 1, n, k + 1, n, dp[i] - 2 * pos[i + 1] - pos[i]);
    }
  }
  dp[n] = min(dp[n], getans(1, 1, n, n) + 3 * pos[n]);
  cout << dp[n] + end - pos[n];
}
