#include <bits/stdc++.h>
using namespace std;
const long long N = 100 * 1000 + 5;
long long n;
long long e, t;
long long a[N];
long long dp[N];
long long get(long long i, long long j) {
  return min(t * (i - j) + a[i] - a[j],
             0ll + 2ll * (a[i] - a[j + 1]) + (a[i] - a[j]) +
                 1ll * max(0ll, t - 2ll * (a[i] - a[j + 1]))) +
         dp[j];
}
int32_t main() {
  cin >> n >> e >> t;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  dp[0] = 0;
  long long p = 0;
  for (long long i = 1; i <= n; i++) {
    dp[i] = get(i, 0);
    for (long long j = 1; j < i; j++) {
      dp[i] = min(dp[i], get(i, j));
    }
  }
  cout << dp[n] + e - a[n];
  return 0;
}
