#include <bits/stdc++.h>
using namespace std;
const long long N = 100005;
set<pair<long long, long long> > s;
long long n, e, t, x[N], f[N], dp[N], d[N];
signed main() {
  scanf("%lld%lld%lld", &n, &e, &t);
  for (long long i = 1; i <= n; i++) scanf("%lld", &x[i]);
  e -= x[n];
  x[n + 1] = e;
  for (long long i = n; i; i--) x[i] -= x[i - 1];
  for (long long i = 1; i <= n; i++) f[i] = f[i - 1] + x[i];
  long long l = 0, r = -1, k = 0;
  s.insert(make_pair(0, 0));
  for (long long i = 1; i <= n; i++) {
    while (k < i && (f[i] - f[k + 1]) * 2 > t) {
      s.erase(make_pair(x[k + 1] - f[k + 1] + dp[k], k));
      while (l <= r && -3 * f[k + 1] + x[k + 1] + dp[k] <=
                           -3 * f[d[r] + 1] + x[d[r] + 1] + dp[d[r]])
        r--;
      d[++r] = k;
      k++;
    }
    pair<long long, long long> now = *s.begin();
    dp[i] = t + now.first + f[i];
    if (l <= r)
      dp[i] = min(dp[i], f[i] * 3 - 3 * f[d[r] + 1] + x[d[r] + 1] + dp[d[r]]);
    s.insert(make_pair(x[i + 1] - f[i + 1] + dp[i], i));
  }
  printf("%lld\n", dp[n] + e);
}
