#include <bits/stdc++.h>
using namespace std;
int n, e, t;
int x[100010];
long long dp[100010];
set<long long> st1;
set<long long> st2;
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;
  st1.insert(-2LL * x[1]);
  st2.insert(t);
  for (int i = 1; i <= n; ++i) {
    while (last + 1 <= i && 2LL * (x[i] - x[last + 1]) >= t) {
      st1.insert(dp[last] - x[last] - 2LL * x[last + 1]);
      st2.erase(dp[last] - x[last] + t);
      ++last;
    }
    if (last - 1 >= 0)
      dp[i] = min(*st1.begin() + 3LL * x[i], *st2.begin() + x[i]);
    else
      dp[i] = *st2.begin() + x[i];
    st2.insert(dp[i] - x[i] + t);
  }
  cout << dp[n] + e - x[n];
  return 0;
}
