#include <bits/stdc++.h>
using namespace std;
int n, e, t, x[100010];
long long dp[100010], preMin[100010];
set<long long> st;
int main() {
  scanf("%d%d%d", &n, &e, &t);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &x[i]);
  }
  dp[0] = 0;
  x[0] = 0;
  int last = 0;
  preMin[0] = -2 * x[1];
  st.insert(t);
  for (int i = 1; i <= n; ++i) {
    while (last + 1 <= i && 2LL * (x[i] - x[last + 1]) >= t) {
      st.erase(dp[last] - x[last] + t);
      ++last;
    }
    dp[i] = (((long long)1) << 50);
    if (last - 1 >= 0) dp[i] = min(dp[i], preMin[last - 1] + 3LL * x[i]);
    if (!st.empty()) dp[i] = min(dp[i], *st.begin() + x[i]);
    if (i < n) st.insert(dp[i] - x[i] + t);
    preMin[i] = min(dp[i] - x[i] - 2LL * x[i + 1], preMin[i - 1]);
  }
  printf("%lld\n", dp[n] + e - x[n]);
  return 0;
}
