#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& o, vector<T>& v) {
  for (auto& x : v) o << x << ' ';
  return o;
}
const int MAXN = 100010;
long long n, T, E;
long long arr[MAXN];
long long memo_small[MAXN];
long long dp_small(int id) {
  if (id == n) return E - arr[n - 1];
  long long& res = memo_small[id];
  if (res != -1) return res;
  long long pre = arr[id];
  if (id) pre = arr[id] - arr[id - 1];
  res = LLONG_MAX / 2;
  for (int i = id; i < n; i++) {
    long long d = arr[i] - arr[id];
    long long cur = pre + max(2LL * d, T) + d + dp_small(i + 1);
    if (cur < res) res = cur;
  }
  return res;
}
void solve_small() {
  memset(memo_small, -1, sizeof memo_small);
  long long res = dp_small(0);
  cout << res << endl;
}
long long memo[MAXN];
long long dp(int id) {
  if (id == n) return E - arr[n - 1];
  long long& res = memo[id];
  if (res != -1) return res;
  long long pre = arr[id];
  if (id) pre = arr[id] - arr[id - 1];
  int i;
  for (i = id; i < n; i++) {
    long long d = arr[i] - arr[id];
    if (i != id) {
      long long di = arr[i] - arr[i - 1];
      if (di > T) break;
    }
    if (2LL * d > (i - id + 1) * T) break;
  }
  long long d = arr[i - 1] - arr[id];
  res = pre + max(2LL * d, T) + d + dp(i);
  return res;
}
void solve_large() {
  memset(memo, -1, sizeof memo);
  long long res = dp(0);
  cout << res << endl;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> E >> T;
  for (int i = 0; i < n; i++) cin >> arr[i];
  if (n <= 2000)
    solve_small();
  else
    solve_large();
}
