#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1e6;
const long long INF = 2e18;
long long N, E, T, cur, arr[MAX], dp[MAX], pre[3000][3000];
long long cal(long long ind) {
  if (ind == N + 1) return 0;
  if (dp[ind] != -1) return dp[ind];
  dp[ind] = INF;
  for (long long A = ind; A <= N; A++)
    dp[ind] = min(dp[ind], pre[ind][A] + (arr[A + 1] - arr[A]) + cal(A + 1));
  return dp[ind];
}
signed main() {
  ios_base::sync_with_stdio(false);
  for (long long A = 1; A <= N + 3; A++) dp[A] = -1;
  cin >> N >> E >> T;
  for (long long A = 1; A <= N; A++) cin >> arr[A];
  arr[N + 1] = E;
  for (long long A = 1; A <= N; A++)
    for (long long B = A; B <= N; B++) {
      cur = T - 2 * (arr[B] - arr[A]);
      if (cur <= 0)
        pre[A][B] = 3 * (arr[B] - arr[A]);
      else
        pre[A][B] = T - 2 * (arr[B] - arr[A]) + 3 * (arr[B] - arr[A]);
    }
  cout << cal(1) + arr[1];
  return 0;
}
