#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 100;
long long dp[MAXN], tmp[MAXN], nx[MAXN], a[MAXN];
int32_t main() {
  int n;
  cin >> n;
  if (n > 10000) return 0;
  int e, t;
  cin >> e >> t;
  for (int i = 0; i < n; i++) cin >> a[i];
  int l = n - 1;
  for (int i = n - 1; i >= 0; i--) {
    while (l > 0 && 2 * (a[i] - a[l - 1]) <= t) l--;
    nx[i] = l;
  }
  memset(dp, 63, sizeof dp);
  memset(tmp, 63, sizeof tmp);
  dp[0] = 0;
  tmp[0] = -2 * a[0];
  for (int i = 1; i <= n; i++) {
    dp[i] = t + dp[nx[i - 1]];
    if (nx[i - 1]) dp[i] = min(dp[i], 2 * a[i - 1] + tmp[nx[i - 1] - 1]);
    tmp[i] = min(tmp[i - 1], dp[i] - 2 * a[i]);
  }
  cout << dp[n] + e;
}
