#include <bits/stdc++.h>
using namespace std;
int x[100009];
long long f[100009];
const long long INF = 1000000000000000000;
int main() {
  int n, e, t;
  cin >> n >> e >> t;
  for (int i = 1; i <= n; ++i) cin >> x[i];
  x[0] = 0;
  f[0] = 0;
  for (int i = 1; i <= n; ++i) {
    f[i] = INF;
    for (int j = 1; j <= i; ++j) {
      long long cur = f[j - 1] + x[j] - x[j - 1];
      long long curt = x[i] - x[j];
      cur += 2 * curt;
      if (t <= 2 * curt) {
        cur += curt;
      } else {
        cur += curt + (t - 2 * curt);
      }
      f[i] = min(f[i], cur);
    }
  }
  long long ans = f[n] + e - x[n];
  cout << ans << endl;
}
