#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const long long INF = (1LL << 60);
int n, T, E;
int X[N];
struct Node {
  int l, r;
  long long Min[2], lazy;
  void gao(int f) {
    lazy += f;
    Min[0] += f;
    Min[1] += f;
  }
} node[N * 4];
void pushdown(int x) {
  if (node[x].lazy) {
    node[(1 << x)].gao(node[x].lazy);
    node[((1 << x) | 1)].gao(node[x].lazy);
    node[x].lazy = 0;
  }
}
void pushup(int x) {
  for (int i = 0; i < 2; i++)
    node[x].Min[i] = min(node[(1 << x)].Min[i], node[((1 << x) | 1)].Min[i]);
}
void build(int l, int r, int x = 1) {
  node[x].l = l;
  node[x].r = r;
  node[x].lazy = 0;
  if (l == r) {
    node[x].Min[0] = 0;
    node[x].Min[1] = X[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, (1 << x));
  build(mid + 1, r, ((1 << x) | 1));
  pushup(x);
}
void add(int l, int r, int w, int x = 1) {
  if (node[x].l >= l && node[x].r <= r) {
    node[x].gao(w);
    return;
  }
  int mid = (node[x].l + node[x].r) >> 1;
  pushdown(x);
  if (l <= mid) add(l, r, w, (1 << x));
  if (r > mid) add(l, r, w, ((1 << x) | 1));
  pushup(x);
}
long long query(int l, int r, int tp, int x = 1) {
  if (l > r) return INF;
  if (node[x].l >= l && node[x].r <= r) {
    return node[x].Min[tp];
  }
  int mid = (node[x].l + node[x].r) >> 1;
  pushdown(x);
  long long ans = INF;
  if (l <= mid) ans = min(ans, query(l, r, tp, (1 << x)));
  if (r > mid) ans = min(ans, query(l, r, tp, ((1 << x) | 1)));
  pushup(x);
}
long long dp[N];
int main() {
  while (~scanf("%d%d%d", &n, &E, &T)) {
    for (int i = 1; i <= n; i++) scanf("%d", &X[i]);
    build(0, n);
    int v = 0;
    for (int i = 1; i <= n; i++) {
      dp[i] = INF;
      for (int j = 0; j < i; j++) {
        dp[i] = min(dp[i], dp[j] + max((X[i] - X[j + 1]) * 2, T) + X[i] - X[j]);
      }
    }
    printf("%lld\n", dp[n] + E - X[n]);
  }
  return 0;
}
