#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using int64 = long long int;
template <typename T>
void chmax(T &a, T b) {
  a = max(a, b);
}
template <typename T>
void chmin(T &a, T b) {
  a = min(a, b);
}
template <typename T>
void chadd(T &a, T b) {
  a = a + b;
}
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD = 1000000007LL;
ll dp[200010];
int main() {
  ll N, E, T;
  scanf("%lld%lld%lld", &N, &E, &T);
  vector<ll> S(N + 1);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &S[i + 1]);
  }
  fill(dp, dp + N + 1, LONGINF);
  dp[0] = 0;
  vector<ll> f1(N + 1, -LONGINF), f2(N + 1, -LONGINF);
  ll ans = (S[1] - 0) + (E - S[N]), j = 0, d = 0;
  for (int i = 0; i <= N; i++) {
    if (i == N) continue;
    ll e = (i + 1 < N ? S[i + 2] - S[i + 1] : 0);
    while (j <= i and 2 * (S[i + 1] - S[j + 1]) >= T) {
      ll v = dp[j] - 3 * S[j + 1];
      f1[j] = v - 3 * d;
      if (j > 0) chmin(f1[j], f1[j - 1]);
      j++;
    }
    {
      ll v = dp[i] + T;
      f2[i] = v - d;
    }
    chmin(dp[i + 1],
          min((j ? f1[j - 1] + 3 * (S[i + 1] + d) : LONGINF), f2[j] + d) + e);
    d += S[i + 2] - S[i + 1];
  }
  ans += dp[N];
  printf("%lld\n", ans);
  return 0;
}
