#include <bits/stdc++.h>
using namespace std;
int n, m, t, x[3123456];
char ch, B[1 << 20], *S = B, *T = B;
int aa, bb;
int F() {
  int x;
  scanf("%d", &x);
  return x;
  while (ch = (S == T && (T = (S = B) + fread(B, 1, 1 << 20, stdin), S == T)
                   ? 0
                   : *S++),
         !(ch >= '0' && ch <= '9') && ch != '-')
    ;
  ch == '-' ? aa = bb = 0 : (aa = ch - '0', bb = 1);
  while (ch = (S == T && (T = (S = B) + fread(B, 1, 1 << 20, stdin), S == T)
                   ? 0
                   : *S++),
         (ch >= '0' && ch <= '9'))
    aa = aa * 10 + ch - '0';
  return bb ? aa : -aa;
}
namespace fob {
char b[5000000] = {}, *f = b, *g = b + 5000000 - 2;
}
struct foce {
  ~foce() {
    (fwrite(fob::b, sizeof(char), fob::f - fob::b, stdout), fob::f = fob::b, 0);
    fflush(stdout);
  }
} _foce;
namespace ib {
char b[100];
}
inline void pll(long long x) {
  if (x == 0) {
    (*(fob::f++) = (48), (fob::f == fob::g) ? (fwrite(fob::b, sizeof(char),
                                                      fob::f - fob::b, stdout),
                                               fob::f = fob::b, 0)
                                            : 0);
    return;
  }
  char *s = ib::b;
  while (x) *(++s) = x % 10, x /= 10;
  while (s != ib::b)
    (*(fob::f++) = ((*(s--)) + 48),
     (fob::f == fob::g)
         ? (fwrite(fob::b, sizeof(char), fob::f - fob::b, stdout),
            fob::f = fob::b, 0)
         : 0);
}
long long qf[3123456], f[3123456];
int main() {
  n = F(), m = F(), t = F();
  for (int i = 1; i <= n; i++) x[i] = F();
  int p = 0;
  f[0] = qf[0] = 0;
  for (int i = 1; i <= n; i++) {
    while (p <= 2 * (x[i] - x[p + 1]) && p < i) ++p;
    long long c = 1e18;
    if (p < i) c = min(c, f[p] + max(t, 2 * (x[i] - x[p + 1])));
    if (p) c = min(c, qf[p - 1] + 2 * x[i]);
    f[i] = c;
    qf[i] = min(qf[i - 1], f[i] - 2LL * x[i + 1]);
  }
  printf("%lld\n", f[n] + x[n]);
}
