#include <bits/stdc++.h>
using namespace std;
const long long SZ = 1e5 + 10, INF = 1e9 * 1e9;
long long dp[SZ], push[SZ * 8][4], tree[SZ * 8][4];
void p(long long v, long long ind) {
  tree[v * 2 + 1][ind] += push[v][ind];
  tree[v * 2 + 2][ind] += push[v][ind];
  push[v * 2 + 1][ind] += push[v][ind];
  push[v * 2 + 2][ind] += push[v][ind];
  push[v][ind] = 0;
}
long long get(long long v, long long l, long long r, long long askl,
              long long askr, long long ind) {
  p(v, ind);
  if (l >= askr || r <= askl) {
    return INF;
  }
  if (l >= askl && r <= askr) {
    return tree[v][ind];
  }
  long long mid = (l + r) / 2;
  long long q = get(v * 2 + 1, l, mid, askl, askr, ind),
            q2 = get(v * 2 + 2, mid, r, askl, askr, ind);
  return min(q, q2);
}
void upd(long long v, long long l, long long r, long long askl, long long askr,
         long long add, long long ind) {
  p(v, ind);
  if (l >= askr || r <= askl) return;
  if (l >= askl && r <= askr) {
    tree[v][ind] += add;
    push[v][ind] += add;
    return;
  }
  long long mid = (l + r) / 2;
  upd(v * 2 + 1, l, mid, askl, askr, add, ind);
  upd(v * 2 + 2, mid, r, askl, askr, add, ind);
  tree[v][ind] = min(tree[v * 2 + 1][ind], tree[v * 2 + 2][ind]);
}
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  ;
  long long n, e, t;
  cin >> n >> e >> t;
  vector<long long> vec(n);
  for (long long i = 0; i < n; i++) cin >> vec[i];
  vec.push_back(vec.back());
  for (long long i = n - 1; i >= 0; i--) {
    dp[i] = dp[i + 1] + (vec[i + 1] - vec[i]) + t;
    upd(0, 0, n + 1, i + 1, n + 1, (vec[i + 1] - vec[i]) * 1, 0);
    upd(0, 0, n + 1, i + 1, n + 1, (vec[i + 1] - vec[i]) * 3, 1);
    long long l = i, r = n;
    while (r - l > 1) {
      long long mid = (l + r) / 2;
      if ((vec[mid] - vec[i]) * 2 >= t) {
        r = mid;
      } else {
        l = mid;
      }
    }
    long long q = INF;
    if (i + 1 < r - 1) q = get(0, 0, n + 1, i + 1, r - 1, 0) + t;
    if (r != n) q = min(q, get(0, 0, n + 1, r, n, 1));
    dp[i] = min(dp[i], q);
    upd(0, 0, n + 1, i, i + 1, dp[i + 1] + (vec[i + 1] - vec[i]), 0);
    upd(0, 0, n + 1, i, i + 1, dp[i + 1] + (vec[i + 1] - vec[i]), 1);
  }
  cout << dp[0] + (e - vec.back()) + vec.front();
  return 0;
}
