#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
const long long inf = 1LL << 60;
int N, T, E, X[maxn];
long long tree1[maxn], tree2[maxn], f[maxn];
inline int gi() {
  char ch;
  int ret = 0, f = 1;
  do ch = getchar();
  while (!(ch >= '0' && ch <= '9') && ch != '-');
  if (ch == '-') f = -1, ch = getchar();
  do ret = ret * 10 + ch - '0', ch = getchar();
  while (ch >= '0' && ch <= '9');
  return ret * f;
}
inline void build(int now, int l, int r) {
  tree1[now] = tree2[now] = inf;
  if (l == r) return;
  int mid = (l + r) >> 1;
  build(now << 1, l, mid);
  build(now << 1 | 1, mid + 1, r);
}
inline void modify(long long *tree, int now, int l, int r, int pos,
                   long long key) {
  if (l == r) {
    tree[now] = key;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    modify(tree, now << 1, l, mid, pos, key);
  else
    modify(tree, now << 1 | 1, mid + 1, r, pos, key);
  tree[now] = min(tree[now << 1], tree[now << 1 | 1]);
}
inline long long query(long long *tree, int now, int l, int r, int ql, int qr) {
  if (ql == l && qr == r) return tree[now];
  int mid = (l + r) >> 1;
  if (qr <= mid)
    return query(tree, now << 1, l, mid, ql, qr);
  else if (ql > mid)
    return query(tree, now << 1 | 1, mid + 1, r, ql, qr);
  else
    return min(query(tree, now << 1, l, mid, ql, mid),
               query(tree, now << 1 | 1, mid + 1, r, mid + 1, qr));
}
int main() {
  N = gi();
  E = gi();
  T = gi();
  for (int i = 1; i <= N; ++i) X[i] = gi(), tree1[i] = tree2[i] = 1LL << 60;
  for (int i = 1; i <= N; ++i) {
    modify(tree1, 1, 1, N, i,
           f[i - 1] + (long long)X[i] - 3LL * (long long)X[i] -
               (long long)X[i - 1]);
    int l = 0, r = i - 1, mid;
    f[i] = inf;
    while (l <= r) {
      mid = (l + r) >> 1;
      if (T - 2LL * (X[i] - X[mid + 1]) <= 0)
        l = mid + 1;
      else
        r = mid - 1;
    }
    if (r + 1) f[i] = query(tree1, 1, 1, N, 1, r + 1) + 3LL * X[i];
    for (int j = r + 1; j <= r + 3 && j < i; ++j)
      f[i] = min(f[j] + (long long)X[j + 1] - 3LL * (long long)X[j + 1] -
                     (long long)X[j] + 3LL * (long long)X[i] +
                     (long long)(i - j) *
                         (long long)((long long)T - 2LL * (X[i] - X[j + 1])),
                 f[i]);
  }
  cout << f[N] + (long long)E - (long long)X[N] << endl;
  return 0;
}
