#include <bits/stdc++.h>
using namespace std;
template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()) {
  v.assign(a, vector<T>(b, t));
}
template <class F, class T>
void convert(const F &f, T &t) {
  stringstream ss;
  ss << f;
  ss >> t;
}
void mainmain() {
  int n;
  cin >> n;
  long long E, T;
  cin >> E >> T;
  vll v(n);
  for (int(i) = (0); (i) < ((n)); ++(i)) cin >> v[i];
  v.push_back(E);
  v.push_back(0x3f3f3f3f3f3f3f3fLL);
  n++;
  vll dp(n, 0x3f3f3f3f3f3f3f3fLL);
  dp[0] = 0;
  for (int(i) = (0); (i) < ((n - 1)); ++(i)) {
    int it = upper_bound((v).begin(), (v).end(), v[i] + T / 2) - v.begin();
    dp[min(it, n - 1)] = min(dp[min(it, n - 1)], dp[i] + T);
    int p = it + 1;
    int it2 = upper_bound((v).begin(), (v).end(), v[i] + T) - v.begin();
    for (int j = (p); j < (it2 + 1); ++j) {
      dp[min(j, n - 1)] = min(dp[min(j, n - 1)], dp[i] + 2 * (v[j - 1] - v[i]));
    }
  }
  cout << dp[n - 1] + E << endl;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20);
  mainmain();
}
