#include <bits/stdc++.h>
const int MAX_N = 100005;
uint32_t cache[MAX_N];
int bpos[MAX_N];
int N, E, T;
int main() {
  scanf("%d %d %d", &N, &E, &T);
  bpos[0] = 0;
  for (int i = 0; i < N; ++i) {
    scanf("%d", bpos + i + 1);
    cache[i + 1] = UINT_MAX;
  }
  for (int i = 0; i < N; ++i) {
    cache[i + 1] = std::min(cache[i + 1], cache[i] + bpos[i + 1] - bpos[i] + T);
    for (int j = i + 2; j <= N; ++j) {
      uint32_t d = bpos[j] - bpos[i + 1];
      uint32_t d2 = bpos[j] - bpos[j - 1];
      uint32_t cost = bpos[i + 1] - bpos[i] + 3 * d +
                      std::max(0LL, uint32_t(T) - 2LL * d2) + cache[i];
      if (cost >= cache[j]) break;
      cache[j] = std::min(cache[j], cost);
    }
  }
  printf("%u\n", cache[N] + E - bpos[N]);
}
