#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T fromString(const string &s) {
  T res;
  istringstream iss(s);
  iss >> res;
  return res;
};
template <typename T>
inline string toString(const T &a) {
  ostringstream oss;
  oss << a;
  return oss.str();
};
template <typename T = int>
inline void dump(vector<T> vs, bool ent = false) {
  for (int i = 0; i < (int)(vs.size()); i++)
    cout << vs[i] << (i + 1 == vs.size() ? '\n' : ' ');
  if (ent) cout << endl;
}
template <typename T = int>
inline void dump(vector<vector<T>> vs, bool ent = false) {
  for (int i = 0; i < (int)(vs.size()); i++) dump<T>(vs[i]);
  if (ent) cout << endl;
}
const int INF = 0x3f3f3f3f;
const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
const double DINF = 0x3f3f3f3f;
const int DX[] = {1, 0, -1, 0};
const int DY[] = {0, -1, 0, 1};
const double EPS = 1e-12;
template <typename T = int>
inline T in() {
  T x;
  cin >> x;
  return x;
}
template <typename T = int>
inline vector<T> in(int n) {
  vector<T> xs(n);
  for (int i = 0; i < (int)(n); i++) cin >> xs[i];
  return xs;
}
template <typename T = int>
inline vector<vector<T>> in(int n, int m) {
  vector<vector<T>> xs(n, vector<T>(m));
  for (int i = 0; i < (int)(n); i++)
    for (int j = 0; j < (int)(m); j++) cin >> xs[i][j];
  return xs;
}
int main(void) {
  long long N, E, T;
  cin >> N >> E >> T;
  vector<long long> xs = in<long long>(N);
  if (N > 2000) return -1;
  vector<long long> dp(N, INFL);
  for (int i = N - 1; i >= 0; i--) {
    {
      long long t = T;
      if (i + 1 < N) t += dp[i + 1] + (xs[i + 1] - xs[i]);
      dp[i] = min(dp[i], t);
    }
    for (int j = i + 1; j < N; j++) {
      long long d = xs[j] - xs[i];
      long long m = d * 2;
      long long k = max(0LL, T - m);
      long long t = m + k + d;
      if (j + 1 < N) t += dp[j + 1] + (xs[j + 1] - xs[j]);
      dp[i] = min(dp[i], t);
    }
  }
  long long ans = dp[0] + xs[0] + E - xs[N - 1];
  cout << ans << endl;
  return 0;
}
