#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
inline void chmin(A &a, B b) {
  if (a > b) a = b;
}
template <typename A, typename B>
inline void chmax(A &a, B b) {
  if (a < b) a = b;
}
long long N, E, T;
long long X[100000];
long long dp[2222];
signed main() {
  cin >> N >> E >> T;
  if (N > 2000) return 0;
  X[0] = 0;
  for (long long i = 1; i <= N; i++) cin >> X[i];
  fill_n(dp, 2222, 1001001001001001001ll);
  dp[0] = 0;
  for (long long i = 0; i < N; i++) {
    for (long long j = i + 1; j <= N; j++) {
      if (2 * (X[j] - X[i + 1]) >= T)
        chmin(dp[j], dp[i] + X[j] - X[i] + 2 * (X[j] - X[i + 1]));
      else
        chmin(dp[j], dp[i] + X[i + 1] - X[i] + T + X[j] - X[i + 1]);
    }
  }
  cout << dp[N] + E - X[N] << endl;
  return 0;
}
