#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1e18;
const int inf = (int)1e9;
const long long mod = (long long)1e9 + 7;
const double pi = acos(-1.0);
const double eps = (double)1e-9;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int N = 300500;
int n;
long long x[N], dp[N], t, e, dp2[N];
int main() {
  srand(time(NULL));
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  cout << setprecision(10) << fixed;
  cin >> n >> e >> t;
  for (int i = 1; i <= n; ++i) cin >> x[i];
  dp[0] = 0;
  int cur = 1;
  dp2[0] = INF;
  for (int i = 1; i <= n; ++i) {
    while (t - 2LL * (x[i] - x[cur]) < 0) cur++;
    dp[i] = min(dp2[cur - 1] + 2LL * x[i], dp[cur - 1] + t);
    dp2[i] = min(dp2[i], dp[i - 1] - 2LL * x[i]);
  }
  cout << dp[n] + e;
  return 0;
}
