#include <bits/stdc++.h>
using namespace std;
const int MAX = 100100;
const long long inf = 1e18;
int x[MAX];
long long f[MAX];
int main(void) {
  int N, E, T;
  scanf("%d %d %d", &N, &E, &T);
  for (int i = (0); i < (N); ++i) scanf("%d", &x[i]);
  f[0] = 0;
  multiset<long long> S2;
  S2.insert(f[0] - x[0]);
  int j = 0;
  long long best = inf;
  for (int i = 1; i <= N; ++i) {
    while (j < i && 2 * (x[i - 1] - x[j]) > T) {
      S2.erase(S2.find(f[j] - x[j]));
      best = min(best, f[j] - 2 * x[j]);
      j++;
    }
    f[i] = best + 2 * x[i - 1];
    if (S2.size()) f[i] = min(f[i], *S2.begin() + T + x[i - 1]);
    S2.insert(f[i] - x[i]);
  }
  long long ans = E + f[N];
  printf("%lld\n", ans);
  return 0;
}
