#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
const int mod = 1000000007, MAX = 2005;
const long long INF = 1LL << 60;
long long dp[MAX];
int main() {
  std::ifstream in("text.txt");
  std::cin.rdbuf(in.rdbuf());
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N, E, T;
  cin >> N >> E >> T;
  if (N > 2000) return 1;
  vector<long long> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  A.push_back(0);
  sort((A).begin(), (A).end());
  for (int i = 1; i <= N + 1; i++) dp[i] = INF;
  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j <= N; j++) {
      long long need = A[i + 1] - A[i];
      long long dis = (A[j] - A[i + 1]) * 2;
      chmin(dp[j], dp[i] + need + max(T, dis) + dis);
    }
  }
  cout << dp[N] + E - A[N] << endl;
}
