#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, e, t;
  cin >> n >> e >> t;
  vector<long long> x(n + 10, 0);
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
  }
  int l = 0;
  vector<int> p(n + 1);
  for (int i = 0; i <= n; i++) {
    while ((x[i] - x[l]) * 2 > t) l++;
    p[i] = l;
  }
  vector<long long> dp(n + 10, 10000000000);
  dp[0] = e;
  vector<long long> dp2(n + 10, 10000000000);
  dp2[0] = 10000000000;
  dp2[1] = 10000000000;
  dp2[2] = e - 2 * x[1];
  for (int i = 1; i <= n; i++) {
    long long mi = 10000000000;
    dp[i] = dp[max(0, p[i] - 1)] + t;
    mi = dp2[p[i]];
    dp[i] = min(dp[i], mi + 2 * x[i]);
    dp2[i + 2] = min(dp[i + 1], dp[i] - 2 * x[i + 1]);
  }
  cout << dp[n] << endl;
  return 0;
}
