#include <bits/stdc++.h>
using namespace std;
void init_ios() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
}
const long long N = (long long)1e5 + 10;
long long n, e, t;
long long x[N], dp[N];
signed main() {
  init_ios();
  cin >> n >> e >> t;
  for (long long i = 1; i <= n; ++i) cin >> x[i];
  dp[n] = t + e - x[n];
  for (long long i = n - 1; i >= 1; --i) {
    dp[i] = 1e18;
    for (long long j = i; j <= n; ++j) {
      long long tmp = max(t, 2 * (x[j] - x[i])) + (x[j] - x[i]);
      if (j < n)
        tmp += x[j + 1] - x[j] + dp[j + 1];
      else
        tmp += e - x[n];
      dp[i] = min(dp[i], tmp);
    }
  }
  cout << x[1] + dp[1] << "\n";
}
