#include <bits/stdc++.h>
using std::bitset;
using std::cerr;
using std::cin;
using std::cout;
using std::deque;
using std::endl;
using std::fill;
using std::fixed;
using std::ios_base;
using std::iterator;
using std::map;
using std::max_element;
using std::min_element;
using std::multimap;
using std::multiset;
using std::pair;
using std::queue;
using std::reverse;
using std::set;
using std::setprecision;
using std::sort;
using std::stable_sort;
using std::stack;
using std::string;
using std::swap;
using std::unique;
using std::vector;
long long min(long long a, long long b) { return a < b ? a : b; }
long long min(int a, long long b) { return a < b ? a : b; }
long long min(long long a, int b) { return a < b ? a : b; }
long long min(int a, int b) { return a < b ? a : b; }
long long max(long long a, long long b) { return a > b ? a : b; }
long long max(int a, long long b) { return a > b ? a : b; }
long long max(long long a, int b) { return a > b ? a : b; }
long long max(int a, int b) { return a > b ? a : b; }
const long long INF = 1e18;
const long long N = 210110;
const long long MOD = 998244353;
const double eps = 1e-8;
long long n, e, t;
long long a[N];
long long dp[N];
long long kek, j = -1;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> e >> t;
  for (long long i = 0; i < n; i++) cin >> a[i];
  kek = 1e18;
  set<pair<long long, long long> > ss;
  for (long long i = 0; i < n; i++) {
    dp[i] = (i > 0 ? dp[i - 1] : 0) + t;
    while (2 * (a[i] - a[j + 1]) >= t) {
      ss.erase({dp[j + 1], j + 1});
      kek = min(kek, (j ? dp[j] : 0) - 2 * a[j + 1]);
      j++;
    }
    pair<long long, long long> it = *(ss.begin());
    dp[i] = min(dp[i], min(it.first + t, kek + 2 * a[i]));
    ss.insert({dp[i], i});
  }
  cout << dp[n - 1] + e;
}
