#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
const int MAXN = (int)2e5 + 3;
const int infint = (int)1e9 + 3;
const long long inf = (long long)1e15;
long long n, T, E, x[MAXN], dp[MAXN];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> E >> T;
  for (int i = 1; i <= n; i++) cin >> x[i];
  for (int i = 1; i <= n; i++) dp[i] = inf;
  dp[0] = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < i; j++)
      dp[i] = min(max(dp[j] + x[i] - x[j] + x[i] - x[j + 1],
                      dp[j] + x[j + 1] - x[j] + T) +
                      x[i] - x[j + 1],
                  dp[i]);
  cout << dp[n] + E - x[n];
}
