#include <bits/stdc++.h>
using namespace std;
const long long MOD = static_cast<int>(1e9) + 7;
using namespace std::rel_ops;
inline long long bit(int x) { return 1LL << x; }
template <class T>
inline int size(const T& a) {
  return (int)a.size();
}
template <class T>
inline bool chmin(T& a, const T& b) {
  return a > b ? a = b, 1 : 0;
}
template <class T>
inline int clamp(T v, T lo, T hi) {
  return (v > hi) - (v < lo);
}
template <class T>
inline bool chmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
template <class T>
inline pair<vector<T>, char> operator*(const vector<T>& v, const char& c) {
  return make_pair(v, c);
}
template <class T>
inline istream& operator>>(istream& is, vector<T>& v) {
  for (auto& x : v) is >> x;
  return is;
}
template <class T>
inline ostream& operator<<(ostream& os, const pair<vector<T>, char>& v) {
  bool t = 0;
  for (const T& x : v.first) {
    if (t) os << v.second;
    os << x;
    t = 1;
  }
  return os;
}
template <class T>
inline ostream& operator<<(ostream& os, vector<T>& v) {
  return os << v * ' ';
}
struct before_main {
  before_main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);
    ;
  };
} __before_main;
int n;
long long e, t;
long long x[100020];
long long dp[2020];
long long brute() {
  for (int i = 0, i_len = static_cast<int>(n + 1); i < i_len; i++)
    dp[i] = 1145141919810893LL;
  dp[0] = 0;
  for (int i = 0; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      long long d = x[j] - x[i + 1];
      if (2 * d >= t) {
        chmin(dp[j], dp[i] + (x[i + 1] - x[i]) + 3 * d);
      } else {
        chmin(dp[j], dp[i] + (x[i + 1] - x[i]) + t + d);
      }
    }
  }
  return dp[n] + (e - x[n]);
}
int main() {
  cin >> n >> e >> t;
  for (int i = 0, i_len = static_cast<int>(n); i < i_len; i++) cin >> x[i + 1];
  if (n > 2020) exit(1);
  cout << brute() << endl;
}
