#include <bits/stdc++.h>
using namespace std;
template <class T, class T2>
inline void chkmax(T &x, const T2 &y) {
  if (x < y) x = y;
}
template <class T, class T2>
inline void chkmin(T &x, const T2 &y) {
  if (x > y) x = y;
}
const int MAXN = (1 << 20);
int64_t n, t, e;
int64_t x[MAXN];
void read() {
  cin >> n >> e >> t;
  for (int i = 1; i <= n; i++) cin >> x[i];
}
int64_t dp[MAXN];
void solve() {
  x[0] = 0;
  dp[0] = 0;
  for (int i = 1; i <= n; i++) {
    dp[i] = (int64_t)1e18;
    for (int j = i; j >= 1; j--) {
      int64_t wait_t = max((int64_t)0, t - 2 * (x[i] - x[j]));
      chkmin(dp[i],
             x[i] - x[j - 1] + wait_t + (x[i] - x[j]) * (int64_t)2 + dp[j - 1]);
    }
  }
  cout << dp[n] + e - x[n] << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  read();
  solve();
  return 0;
}
