#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
long long dp[maxn];
long long mi[maxn];
int x[maxn];
int q[maxn], head, tail;
int main() {
  int n, e, t;
  scanf("%d%d%d", &n, &e, &t);
  for (int i = 1; i <= n; i++) scanf("%d", x + i);
  dp[n] = e - x[n] + t;
  head = tail = 0;
  long long mi = 100000000000000000LL;
  q[tail++] = n;
  dp[n + 1] = 0;
  x[n + 1] = e;
  for (int i = n - 1; i; i--) {
    while (head < tail) {
      int u = q[head];
      if ((x[u] - x[i]) * 2 > t) {
        mi = min(mi, dp[u + 1] + x[u] * 2 + x[u + 1]);
        head++;
      } else
        break;
    }
    dp[i] = min(mi - x[i] * 3, dp[i + 1] + t + x[i + 1] - x[i]);
    if (head < tail)
      dp[i] = min(dp[q[head] + 1] + x[q[head] + 1] - x[i] + t, dp[i]);
    while (head < tail) {
      int u = q[tail - 1];
      if (dp[u + 1] + x[u + 1] >= dp[i + 1] + x[i + 1]) {
        tail--;
      } else
        break;
    }
    q[tail++] = i;
  }
  printf("%d\n", dp[1] + x[1]);
  return 0;
}
