#include <bits/stdc++.h>
using namespace std;
int N, E, T;
signed long long X[202020];
signed long long ST1[202020], ST3[202020];
signed long long R[202020];
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  cin >> N >> E >> T;
  x = 0;
  X[N + 1] = E;
  for (i = 1; i <= N; i++) cin >> X[i];
  signed long long mi1 = 0;
  signed long long mi3 = -2 * X[1];
  for (i = 1; i <= N; i++) {
    while (2 * (X[i] - X[x + 1]) > T) {
      mi3 = min(mi3, ST3[x]);
      x++;
    }
    R[i] = min(3 * X[i] + mi3, X[i] + T + mi1);
    ST1[i] = R[i] - X[i];
    mi1 = min(mi1, ST1[i]);
    ST3[i] = R[i] - (X[i] + 2 * X[i + 1]);
  }
  cout << R[N] + E - X[N] << endl;
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  solve();
  return 0;
}
