#include <bits/stdc++.h>
int N, E, T, a[100001];
long long f[100001];
int main() {
  scanf("%d%d%d", &N, &E, &T);
  for (int i = 1; i <= N; i++) scanf("%d", a + i);
  for (int i = 1; i <= N; i++) {
    f[i] = 1LL << 60;
    for (int j = 0; j < i; j++)
      f[i] = std::min(f[i], f[j] + (a[i] - a[j]) + 2 * (a[i] - a[j + 1]) +
                                std::max(0, T - 2 * (a[i] - a[j + 1])));
  }
  printf("%lld\n", f[N] + E - a[N]);
  return 0;
}
