#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline T1 max(T1 a, T2 b) {
  return a < b ? b : a;
}
template <typename T1, typename T2>
inline T1 min(T1 a, T2 b) {
  return a < b ? a : b;
}
namespace ae86 {
const int bufl = 1 << 15;
char buf[bufl], *s = buf, *t = buf;
inline int fetch() {
  if (s == t) {
    t = (s = buf) + fread(buf, 1, bufl, stdin);
    if (s == t) return EOF;
  }
  return *s++;
}
inline int ty() {
  int a = 0, b = 1, c = fetch();
  while (!isdigit(c)) b ^= c == '-', c = fetch();
  while (isdigit(c)) a = a * 10 + c - 48, c = fetch();
  return b ? a : -a;
}
}  // namespace ae86
using ae86::ty;
const int _ = 100007;
const long long linf = 0x3f3f3f3f3f3f3f3f;
int n, tar, que[_] = {0}, he, ta;
long long tim, loc[_], f[_] = {0};
int main() {
  n = ty(), tar = ty(), tim = ty();
  for (int i = 1; i <= n; i++) loc[i] = ty();
  long long temp = linf;
  loc[0] = 0, he = 1, ta = 0, que[++ta] = 0;
  for (int i = 1; i <= n; i++) {
    while (he <= ta && 2 * (loc[i] - loc[que[he] + 1]) > tim)
      temp = min(temp, f[que[he]] - loc[que[he]] - 2 * loc[que[he] + 1]), he++;
    f[i] = min(3 * loc[i] + temp, tim + f[que[ta]] + loc[i] - loc[que[ta]]);
    while (he <= ta && f[que[ta]] - loc[que[ta]] >= f[i] - loc[i]) ta--;
    que[++ta] = i;
  }
  printf("%lld\n", f[n] + tar - loc[n]);
  return 0;
}
