#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 85 - 69;
const long long int Inf = 1e18;
int mn[maxn], a[maxn], n, E, T;
long long int dp[maxn];
deque<int> dq;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> E >> T;
  for (int i = 1; i <= n; i++) cin >> a[i];
  a[n + 1] = E;
  int ptr = 1;
  dq.push_front(0);
  for (int i = 1; i <= n; i++) {
    while (2 * (a[i] - a[ptr]) > T) ptr++;
    while (((int)(dq).size()) and dq.back() + 1 < ptr) dq.pop_back();
    dp[i] = Inf;
    if (((int)(dq).size())) dp[i] = dp[dq.back()] + (a[i] - a[dq.back()]) + T;
    if (ptr >= 2)
      ((dp[i]) =
           min((dp[i]), (dp[mn[ptr - 2]] + 2 * (a[i] - a[mn[ptr - 2] + 1]) +
                         a[i] - a[mn[ptr - 2]])));
    while (((int)(dq).size()) and
           dp[i] - a[i + 1] <= dp[dq.front()] - a[dq.front() + 1])
      dq.pop_front();
    dq.push_front(i);
    mn[i] = mn[i - 1];
    if (dp[i] - 3 * a[i + 1] < dp[mn[i]] - 3 * a[mn[i] + 1]) mn[i] = i;
  }
  cout << dp[n] + E - a[n] << endl;
  return 0;
}
