#include <bits/stdc++.h>
using namespace std;
const long long INF = 10000000000000000;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, e, t;
  cin >> n >> e >> t;
  vector<long long> x(n);
  for (int i = 0; i < n; i++) cin >> x[i];
  long long ans = e;
  vector<long long> dp(n + 1, INF);
  dp[0] = 0;
  vector<long long> dp2(n + 1, INF);
  for (int i = 1; i <= n; i++) {
    dp2[i] = min(dp2[i - 1], dp[i - 1] - x[i - 1] * 2);
    int j = upper_bound(x.begin(), x.begin() + i, x[i - 1] - t / 2) - x.begin();
    dp[i] = min(dp[j] + t, 2 * x[i - 1] + dp2[j]);
  }
  ans += dp[n];
  cout << ans << endl;
  return 0;
}
