#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
const long long INF = 1e14;
int n, E, T, x[N];
long long dp[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> E >> T;
  for (int i = 1; i <= n; i++) cin >> x[i];
  for (int i = 1; i <= n; i++) {
    dp[i] = INF;
    for (int j = i - 1; j >= 0; j--) {
      long long W = max(0LL, 0LL + T + 2LL * x[j + 1] - 2LL * x[i]);
      dp[i] = min(dp[i], dp[j] + 3LL * x[i] - x[j] - 2LL * x[j + 1] + W);
    }
  }
  cout << dp[n] + E - x[n] << '\n';
  return 0;
}
