#include <bits/stdc++.h>
using namespace std;
template <class T>
void debug(T a, T b) {
  for (; a != b; ++a) cerr << *a << ' ';
  cerr << endl;
}
template <class T>
void chmin(T& a, const T& b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T& a, const T& b) {
  if (a < b) a = b;
}
namespace std {
template <class S, class T>
ostream& operator<<(ostream& out, const pair<S, T>& a) {
  out << '(' << a.first << ',' << a.second << ')';
  return out;
}
}  // namespace std
const long long int INF = 1e18;
int n;
long long int L, t;
long long int ar[100005];
long long int dp[100005];
int main() {
  cin >> n >> L >> t;
  for (int i = 0; i < (n); ++i) scanf("%lld", &ar[i]);
  ar[n] = L;
  ++n;
  for (int i = 0; i < (n + 1); ++i) dp[i] = INF;
  dp[0] = ar[0];
  int j = 0;
  for (int i = 0; i < (n); ++i) {
    while (j + 1 < n && (ar[j] - ar[i]) * 2 <= t) ++j;
    if (j + 1 < n)
      chmin(dp[j + 1], dp[i] + (ar[j] - ar[i]) * 2 + ar[j + 1] - ar[i]);
    chmin(dp[j], dp[i] + t + ar[j] - ar[i]);
  }
  long long int res = dp[n - 1];
  cout << res << endl;
  return 0;
}
