#include <bits/stdc++.h>
const long long Infll = 0x3f3f3f3f3f3f3f3f;
const int MN = 200005;
int N, E, T, A[MN];
long long f[MN], g[MN];
int main() {
  scanf("%d%d%d", &N, &E, &T);
  for (int i = 1; i <= N; ++i) scanf("%d", &A[i]);
  int j = 1;
  g[0] = Infll;
  for (int i = 1; i <= N; ++i) {
    while (2 * (A[i] - A[j]) > T) ++j;
    f[i] = std::min(f[j - 1] + T, 2 * A[i] + g[j - 1]);
    g[i] = std::min(g[i - 1], f[j - 1] - 2 * A[j]);
  }
  printf("%lld\n", E + f[N]);
  return 0;
}
