#include <bits/stdc++.h>
#pragma GCC optimise("ofast")
#pragma GCC optimise("unroll-loops")
using namespace std;
const long long N = 2000 + 10;
const long long MOD = 1000000000 + 7;
const long long INF = 1000000000000000000;
const long long LOG = 25;
long long n, E, T, a[N], dp[N];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> E >> T;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  memset(dp, 31, sizeof dp);
  dp[n + 1] = 0;
  a[n + 1] = E;
  for (long long i = n; i >= 1; i--) {
    long long mx = 0;
    for (long long j = i; j <= n; j++) {
      dp[i] = min(dp[i], dp[j + 1] + 3 * (a[j] - a[i]) + a[j + 1] - a[j] +
                             max(0ll, T - 2 * a[j] + 2 * a[i]));
    }
  }
  cout << dp[1] + a[1];
  return 0;
}
