#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3fffffff;
const int SINF = 0x7fffffff;
const long long LINF = 0x3fffffffffffffff;
const long long SLINF = 0x7fffffffffffffff;
const int MAXN = 100007;
int n, T, L;
int a[MAXN];
long long dp[MAXN];
pair<long long, int> q[MAXN];
void init();
void input();
void work();
int main() {
  init();
  input();
  work();
}
void init() { ios::sync_with_stdio(false); }
void input() {
  scanf("%d%d%d", &n, &L, &T);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
}
void work() {
  dp[0] = 0;
  int l = 1, r = 0;
  int nl = 0;
  long long vl = LINF;
  q[++r] = make_pair(dp[0] - a[1], 0);
  for (int i = 1; i <= n; ++i) {
    while (((a[i] - a[nl + 1]) << 1) > T) {
      vl = min(vl, dp[nl] - (a[nl + 1] << 1));
      ++nl;
    }
    while (l <= r && ((a[i] - a[q[l].second + 1]) << 1) > T) ++l;
    dp[i] = min(vl + (a[i] << 1), (l <= r) ? (q[l].first + a[i] + T) : LINF);
    while (l <= r && (q[r].first >= dp[i] - a[i + 1])) --r;
    q[++r] = make_pair(dp[i] - a[i + 1], i);
  }
  cout << dp[n] + L << endl;
}
