#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int x;
  scanf("%d", &x);
  return x;
}
inline void priv(vector<int> a) {
  for (int i = 0; i < ((int)(a).size()); ++i)
    printf("%d%c", a[i], i == (int)(a).size() - 1 ? '\n' : ' ');
}
template <typename T>
istream& operator>>(istream& i, vector<T>& v) {
  for (int j = 0; j < ((int)(v).size()); ++j) i >> v[j];
  return i;
}
template <typename T>
string join(vector<T>& v) {
  stringstream s;
  for (int i = 0; i < ((int)(v).size()); ++i) s << ' ' << v[i];
  return s.str().substr(1);
}
template <typename T>
ostream& operator<<(ostream& o, vector<T>& v) {
  if ((int)(v).size()) o << join(v);
  return o;
}
template <typename T1, typename T2>
istream& operator>>(istream& i, pair<T1, T2>& v) {
  return i >> v.first >> v.second;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& o, pair<T1, T2>& v) {
  return o << v.first << "," << v.second;
}
const int MX = 100005, INF = 1001001001;
const long long int LINF = 1e18;
const double eps = 1e-10;
int n, e, t;
vector<int> x;
long long int dp[MX];
long long int f(int i, int j) {
  return dp[j] + max((x[j - 1] - x[i]) * 2, t) + (x[j] - x[i]);
}
int main() {
  scanf("%d%d%d", &n, &e, &t);
  x = vector<int>(n);
  for (int i = 0; i < (n); ++i) scanf("%d", &x[i]);
  x.push_back(e);
  for (int i = (n)-1; i >= 0; --i) {
    dp[i] = LINF;
    for (int j = i + 1; j <= n; ++j) dp[i] = min(dp[i], f(i, j));
  }
  cout << (dp[0] + x[0]) << endl;
  return 0;
}
