#include <bits/stdc++.h>
using namespace std;
long long inf = 1e16;
signed main() {
  long long n, k, e;
  cin >> n >> e >> k;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  vector<long long> suf(n + 1, inf);
  for (long long i = n - 1; i >= 0; i--) {
    for (long long j = i; j < n; j++) {
      if (j == n - 1) {
        long long now = max(k, 2 * (a[j] - a[i])) + (a[j] - a[i]);
        suf[i] = min(suf[i], now);
      } else {
        long long now =
            max(k, 2 * (a[j] - a[i])) + (a[j + 1] - a[i]) + suf[j + 1];
        suf[i] = min(suf[i], now);
      }
    }
  }
  cout << a[0] + suf[0] + (e - a[n - 1]) << endl;
  return 0;
}
