#include <bits/stdc++.h>
using namespace std;
template <class S, class T>
pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first + t.first, s.second + t.second);
}
template <class S, class T>
pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first - t.first, s.second - t.second);
}
template <class S, class T>
ostream &operator<<(ostream &os, pair<S, T> p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long inf = 1000000001;
const long long INF = (long long)1e18 + 1;
const long double pi = 3.1415926535897932384626433832795028841971L;
vector<int> dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
const long long MOD = 998244353;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ;
  long long n, e, t;
  cin >> n >> e >> t;
  vector<long long> x(n + 1);
  for (int i = 1; i <= (int)(n); i++) cin >> x[i];
  vector<long long> dp(n + 1, INF);
  dp[0] = 0;
  for (int i = 0; i < (int)(n); i++) {
    if (dp[i] == INF) continue;
    long long nx;
    if (t % 2 == 0)
      nx = x[i + 1] + t / 2;
    else
      nx = x[i + 1] + (t + 1) / 2;
    auto itr = lower_bound(x.begin(), x.end(), nx);
    int ni = itr - x.begin();
    if (ni <= n) {
      chmin(dp[ni], dp[i] + (x[i + 1] - x[i]) + (x[ni] - x[i + 1]) * 3);
    }
    ni--;
    assert((x[ni] - x[i + 1]) * 2 <= t);
    if (ni + 1 < x.size()) {
      assert((x[n + 1] - x[i + 1]) * 2 >= t);
    }
    if (ni > i) {
      chmin(dp[ni], dp[i] + (x[i + 1] - x[i]) + t + (x[ni] - x[i + 1]));
    }
  }
  cout << dp[n] + e - x[n] << endl;
}
