#include <bits/stdc++.h>
using namespace std;
int n, E, T, i, k, j, a[111111];
long long f[111111], V1[444444], V2[444444];
void ins(int k, int l, int r, int x, long long z1, long long z2) {
  if (l == r) {
    V1[k] = z1;
    V2[k] = z2;
    return;
  }
  int md = l + r >> 1;
  if (x <= md)
    ins(k << 1, l, md, x, z1, z2);
  else
    ins(k << 1 | 1, md + 1, r, x, z1, z2);
  V1[k] = min(V1[k << 1], V1[k << 1 | 1]);
  V2[k] = min(V2[k << 1], V2[k << 1 | 1]);
}
long long qu1(int k, int l, int r, int x, int y) {
  if (x > y) return 1e18;
  if (x <= l && r <= y) return V1[k];
  int md = l + r >> 1;
  if (y <= md) return qu1(k << 1, l, md, x, y);
  if (x > md) return qu1(k << 1 | 1, md + 1, r, x, y);
  return min(qu1(k << 1, l, md, x, y), qu1(k << 1 | 1, md + 1, r, x, y));
}
long long qu2(int k, int l, int r, int x, int y) {
  if (x > y) return 1e18;
  if (x <= l && r <= y) return V2[k];
  int md = l + r >> 1;
  if (y <= md) return qu2(k << 1, l, md, x, y);
  if (x > md) return qu2(k << 1 | 1, md + 1, r, x, y);
  return min(qu2(k << 1, l, md, x, y), qu2(k << 1 | 1, md + 1, r, x, y));
}
int main() {
  for (i = 0; i < 444444; i++) V1[i] = V2[i] = 1e18;
  scanf("%d%d%d", &n, &E, &T);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (i = 0, k = 0; i <= n; i++) {
    f[i] = 1e18;
    for (; (a[i] - a[k + 1]) * 2 > T && k < i; k++)
      ;
    if (i == 0)
      f[i] = 0;
    else
      f[i] = min(qu1(1, 0, n, k, i - 1) + T + a[i],
                 qu2(1, 0, n, 0, k - 1) + a[i] * 3);
    ins(1, 0, n, i, f[i] - a[i], f[i] - a[i] - a[i + 1] * 2);
  }
  printf("%lld\n", f[n] + E - a[n]);
}
