#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 = 200005;
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;
  vector<long long> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  A.push_back(0);
  A.push_back(INF);
  sort((A).begin(), (A).end());
  for (int i = 1; i <= N + 1; i++) dp[i] = INF;
  dp[0] = 0;
  for (int i = 1; i <= N; i++) {
    auto it = lower_bound((A).begin(), (A).end(), A[i] + (T + 1) / 2);
    chmin(dp[it - A.begin()],
          dp[i - 1] + max((A[it - A.begin()] - A[i]) * 2, T));
    it--;
    chmin(dp[it - A.begin()],
          dp[i - 1] + max((A[it - A.begin()] - A[i]) * 2, T));
  }
  cout << dp[N] + E << endl;
}
