#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100007;
const int INF = 1000000007;
const long long LINF = INF * (long long)INF;
long long A[MAXN], DP[MAXN];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, e, t;
  cin >> n >> e >> t;
  for (int i = (1); i < (n + 1); ++i) {
    cin >> A[i];
    DP[i] = LINF;
  }
  for (int i = (1); i < (n + 1); ++i) {
    int l = 0, r = i - 1, m;
    while (r - l) {
      m = (l + r) / 2;
      if (DP[m] - A[m] + max(t - 2 * A[i], -2 * A[m + 1]) <
          DP[m + 1] - A[m + 1] + max(t - 2 * A[i], -2 * A[m + 2]))
        r = m;
      else
        l = m + 1;
    }
    DP[i] = 3 * A[i] + DP[l] - A[l] + max(t - 2 * A[i], -2 * A[l + 1]);
  }
  cout << DP[n] + e - A[n];
  return 0;
}
