#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool chmax(T& a, const T& b) {
  return a < b ? (a = b, true) : false;
}
template <typename T>
bool chmin(T& a, const T& b) {
  return b < a ? (a = b, true) : false;
}
long long N, E, T;
const long long MAX_N = 131072;
long long dp[MAX_N];
pair<long long, long long> seg_tree[MAX_N * 2];
const long long INF = 1e17;
void update(int idx, pair<long long, long long> val) {
  idx += MAX_N - 1;
  seg_tree[idx] = val;
  while (idx) {
    idx = (idx - 1) / 2;
    seg_tree[idx] = min(seg_tree[idx * 2 + 1], seg_tree[idx * 2 + 2]);
  }
}
void init() {
  for (int i = (0); i < (MAX_N); i++) {
    update(i, {INF, -1});
  }
}
pair<long long, long long> query(int a, int b, int idx, int l, int r) {
  if (b <= l || r <= a) return {INF, -1};
  if (a <= l && r <= b) return seg_tree[idx];
  pair<long long, long long> res = query(a, b, idx * 2 + 1, l, (l + r) / 2);
  chmin(res, query(a, b, idx * 2 + 2, (l + r) / 2, r));
  return res;
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cin >> N >> E >> T;
  vector<long long> A(N);
  for (int i = (0); i < (N); i++) {
    cin >> A[i];
  }
  init();
  fill_n(dp, N + 1, INF);
  dp[0] = 0;
  update(0, make_pair(-A[0], 0));
  for (int i = 1; i <= N; i++) {
    pair<long long, long long> nxt = query(0, i, 0, 0, MAX_N);
    dp[i] = dp[nxt.second];
    long long a = A[i - 1] - (nxt.second > 0 ? A[nxt.second - 1] : 0);
    long long b = A[nxt.second] - (nxt.second > 0 ? A[nxt.second - 1] : 0);
    dp[i] += max(a * 2 - b * 2, T) + a;
    if (i < N) {
      update(i, {dp[i] - (A[i - 1] + A[i]), i});
    }
  }
  cout << dp[N] + (E - A.back()) << endl;
  return 0;
}
