#include <bits/stdc++.h>
using namespace std;
long long x[100005];
long long dp[100005];
int main() {
  int N, E, T;
  scanf("%d %d %d", &N, &E, &T);
  x[0] = 0;
  for (int i = 1; i <= N; ++i) {
    scanf("%lli", &x[i]);
  }
  dp[N] = E - x[N];
  cout << "N = " << N << ", dp[N]= " << dp[N] << endl;
  for (int i = N - 1; i >= 0; --i) {
    dp[i] = 100000000000000000LL;
    for (int j = i + 1; j <= N; ++j) {
      if ((2 * (x[j] - x[i + 1])) > T) {
        dp[i] = min(dp[i], dp[j] + 3 * (x[j] - x[i + 1]) + (x[i + 1] - x[i]));
      } else {
        dp[i] = min(dp[i], dp[j] + (x[j] - x[i + 1]) + T + (x[i + 1] - x[i]));
      }
    }
    cout << "i = " << i << ", dp[i]= " << dp[i] << endl;
  }
  printf("%lli\n", dp[0]);
  return 0;
}
