#include <bits/stdc++.h>
using namespace std;
long long n, d[2010], t, e;
long long f[2010][2010];
int main() {
  cin >> n >> e >> t;
  d[0] = 0;
  if (n > 2010) return 0;
  for (long long i = 0; i < n; i++) cin >> d[i + 1];
  for (long long i = 0; i < 2010; i++)
    for (long long j = 0; j < 2010; j++) f[i][j] = 1e17;
  f[1][0] = 0;
  for (long long i = 0; i < n + 1; i++) {
    for (long long j = 0; j < i + 1; j++) {
      if (i > j) {
        f[i + 1][j] = min(f[i + 1][j], f[i][j] + d[i + 1] - d[i]);
        ;
        long long dis = d[i] - d[j + 1];
        f[i + 1][i] = min(f[i + 1][i], f[i][j] + max(dis, t - dis));
        ;
      }
    }
  }
  cout << e + f[n + 1][n] << endl;
  return 0;
}
