#include <bits/stdc++.h>
using namespace std;
long long n, E, T, x[100000 + 5], dp[100000 + 5];
long long read() {
  char c;
  long long x = 0, f = 1;
  c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * f;
}
signed main() {
  n = read(), E = read(), T = read();
  for (long long i = 1; i <= n; ++i) x[i] = read();
  for (long long i = 1; i <= n; ++i) dp[i] = 10000000000000000;
  for (long long i = 1; i <= n; ++i) {
    for (long long j = 0; j <= i - 1; ++j) {
      dp[i] = min(dp[i], dp[j] - x[j] - 2 * x[j + 1] +
                             max(2 * x[i], T + 2 * x[j + 1]) + x[i]);
    }
  }
  printf("%lld", E - x[n] + dp[n]);
  return 0;
}
