#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N, E, T;
  cin >> N >> E >> T;
  vector<long long int> X(N + 2);
  map<long long int, long long int> M;
  M[0] = 0;
  for (size_t i = 1; i <= N; i++) {
    cin >> X[i];
    M[X[i]] = i;
  }
  X[N + 1] = E;
  M[E] = N + 1;
  vector<long long int> DP(N + 2, LLONG_MAX / 6);
  DP[0] = 0;
  for (size_t now = 0; now < N; now++) {
    long long int nowidx = M[now];
    long long int nextidx = nowidx + 1;
    long long int len = T / 2;
    long long int idxmax = N + 1, idxmin = 0;
    while (idxmin + 1 < idxmax) {
      long long int idxmid = (idxmin + idxmax) / 2;
      if (len + X[nextidx] > X[idxmid]) {
        idxmin = idxmid;
      } else {
        idxmax = idxmid;
      }
    }
    idxmin = max(0LL, idxmin - 1);
    for (size_t i = idxmin; i < N + 1; i++) {
      DP[i] = min(DP[i], DP[now] + X[nextidx] - X[nowidx] +
                             (X[i] - X[nextidx]) * 3 +
                             max(0LL, T - (X[i] - X[nextidx]) * 2));
    }
    DP[now + 1] = min(DP[now + 1], DP[now] + X[now + 1] - X[now] + T);
  }
  cout << DP[N] + X[N + 1] - X[N] << endl;
}
