#include <bits/stdc++.h>
#pragma GCC optimize("O2,unroll-loops")
using namespace std;
const int inf = 1000000010;
const long long INF = 10000000000000010LL;
const int mod = 1000000007;
const int MAXN = 100010, LOG = 20;
long long n, T, u, v, x, y, t, a, b, ans;
long long A[MAXN], dp[MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  cin >> A[n + 1] >> T;
  for (int i = 1; i <= n; i++) cin >> A[i];
  for (int i = n; i; i--) {
    dp[i] = INF;
    for (int j = i; j <= n; j++) {
      long long len = 2 * (A[j] - A[i]);
      long long cost = (A[j + 1] - A[i]) + max(len, T);
      dp[i] = min(dp[i], cost + dp[j + 1]);
    }
  }
  cout << A[1] + dp[1] << "\n";
  return 0;
}
