#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1e6;
const long long INF = 1e18;
long long N, E, T, arr[MAX], dp[MAX], tot[MAX], pre[MAX], nxt[MAX];
void solve() {
  dp[N] = T + E - arr[N];
  for (long long A = N - 1; A >= 1; A--) {
    dp[A] = pre[A] + arr[nxt[A] + 1] - arr[nxt[A]] + dp[nxt[A] + 1];
    for (long long B = nxt[A] + 1; B <= N; B++)
      dp[A] =
          min(dp[A], 3 * (arr[B] - arr[A]) + arr[B + 1] - arr[B] + dp[B + 1]);
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin >> N >> E >> T;
  for (long long A = 1; A <= N; A++) cin >> arr[A];
  for (long long A = 1; A <= N; A++) {
    long long low = A, high = N, mid, res = A;
    while (low <= high) {
      mid = (low + high) / 2;
      if (T - 2 * (arr[mid] - arr[A]) > 0) {
        res = mid;
        low = mid + 1;
      } else
        high = mid - 1;
    }
    nxt[A] = res;
    pre[A] = T - 2 * (arr[res] - arr[A]) + 3 * (arr[res] - arr[A]);
  }
  solve();
  cout << arr[1] + dp[1];
  return 0;
}
