#include <bits/stdc++.h>
using namespace std;
int x[200000];
long long dp[3000][3000];
int main() {
  int n, E, T;
  cin >> n >> E >> T;
  if (n > 2000) abort();
  for (int i = 0; i < (n); i++) scanf("%d", &x[i + 1]);
  x[n + 1] = E;
  memset(dp, 0x3f, sizeof(dp));
  dp[1][0] = x[1];
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < (i); j++) {
      dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + (x[i + 1] - x[i]));
      dp[i + 1][i] = min(dp[i + 1][i], max(dp[i][j] + (x[i] - x[j + 1]),
                                           dp[i][j] - (x[i] - x[j + 1]) + T) +
                                           (x[i + 1] - x[j + 1]));
    }
  cout << dp[n + 1][n] << endl;
}
