#include <bits/stdc++.h>

using namespace std;

const long long inf = (long long) 1e18;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, e, t;
  cin >> n >> e >> t;
  vector<int> x(n + 1);
  for (int i = 0; i < n; i++) {
    cin >> x[i + 1];
  }          
  vector<int> first(n + 1); // first no wait from right to left
  for (int i = n, j = n; i >= 0; i--) {
    while (j > 0 && 2 * x[i] - 2 * x[j] <= t) {
      j--;
    }
    first[i] = j;
  }
  vector<long long> dp(n + 1, inf);
  dp[0] = 0;
  long long min_prefix = inf;
  for (int i = 1, j = 0; i <= n; i++) {
    while (j < first[i]) {
      min_prefix = min(min_prefix, dp[j] - 2 * x[j + 1]);
      j++;
    }
    dp[i] = min(t + dp[j], min_prefix + 2 * x[i]); 
  }
  cout << dp[n] + e << '\n';
  return 0;
}