#include <bits/stdc++.h>
using namespace std;
template <class S, class T>
istream& operator>>(istream& is, pair<S, T>& p) {
  return is >> p.first >> p.second;
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
const long long MOD = 1e9 + 7;
long long dp[100010];
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  long long N, E, T;
  cin >> N >> E >> T;
  vector<long long> xs(N);
  for (int i = (0); i < (N); ++i) cin >> xs[i];
  fill(dp, dp + 100010, 1e15);
  dp[0] = 0;
  int e = 0;
  for (int i = (0); i < (N); ++i) {
    long long t = (i > 0 ? xs[i] - xs[i - 1] : xs[i]);
    for (; e < N; ++e) {
      long long d = xs[e] - xs[i];
      long long tmp = dp[i] + t + d * 3 + max(0ll, T - 2 * d);
      dp[e + 1] = min(dp[e + 1], tmp);
      if (T - 2 * d < 0) break;
    }
    if (e > 0) dp[e] = min(dp[e], dp[i] + t + xs[e - 1] - xs[i] + T);
  }
  cout << dp[N] + E - xs.back() << endl;
  return 0;
}
