#include <bits/stdc++.h>
using namespace std;
long long pre[2001][2001];
long long find_ans(long long l, long long n, vector<long long>& v) {
  long long ans = pre[l][n];
  for (long long j = l; j < n; j++) {
    ans = min(ans, pre[l][j] + find_ans(j + 1, n, v) + v[j + 1] - v[j]);
  }
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, e, t;
  cin >> n >> e >> t;
  vector<long long> v(n + 1, 0);
  long long a[n + 1][n + 1];
  for (long long i = 0; i < n; i++) {
    cin >> v[i + 1];
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = i; j <= n; j++) {
      long long temp = 0;
      long long d = v[j] - v[i];
      temp += 2 * d;
      long long last = v[i];
      for (long long k = i; k <= j; k++) {
        temp += v[k] - last + max(t - 2 * d - (v[k] - v[i]), (long long)0);
        last = v[k];
      }
      pre[i][j] = temp;
    }
  }
  long long ans = v[1];
  ans += find_ans(1, n, v);
  ans += e - v[n];
  cout << ans << endl;
  return 0;
}
