#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N, E, T;
  cin >> N >> E >> T;
  int X[100000];
  for (int i = 0; i < (N); i++) cin >> X[i];
  int D[100000];
  for (int i = 1; i <= (N - 1); i++) D[i] = X[i] - X[i - 1];
  map<long long, long long> dp[100001];
  dp[0][0] = E;
  for (int i = 1; i <= (N - 1); i++) {
    dp[i][0] = 1e18;
    long long besuto = 0;
    for (auto itr = dp[i - 1].rbegin(); itr != dp[i - 1].rend(); itr++) {
      long long saizu = (*itr).first;
      long long jikan = (*itr).second;
      if (D[i] * 2 < T) {
        dp[i][saizu + D[i] * 2] = jikan;
      } else if (D[i] * 2 >= T * 2) {
        dp[i][0] = min(dp[i][0], jikan + max(T, saizu));
      } else {
        dp[i][0] = min(dp[i][0], jikan + max(T, saizu));
        if (saizu < T) dp[i][saizu + D[i] * 2] = jikan;
      }
    }
  }
  long long kotae = 1e18;
  for (auto itr = dp[N - 1].rbegin(); itr != dp[N - 1].rend(); itr++) {
    long long saizu = (*itr).first;
    long long jikan = (*itr).second;
    kotae = min(kotae, jikan + max(T, saizu));
  }
  cout << (kotae) << "\n";
  return 0;
}
