#include <bits/stdc++.h>
int x[2005];
long long dp[2005][2005];
long long min(long long a, long long b) { return a < b ? a : b; }
int main() {
  int N, E, T;
  scanf("%d%d%d", &N, &E, &T);
  for (int i = 1; i <= N; i++) scanf("%d", &x[i]);
  for (int i = 1; i <= N; i++) {
    for (int last = 0; last < i; last++)
      dp[i][last] = dp[i - 1][last] + x[i] - x[i - 1];
    dp[i][i] = 1e18;
    for (int pick = i; pick >= 1; pick--) {
      long long ptime = 2 * (x[i] - x[pick]);
      long long addcst = T - ptime;
      if (addcst < 0) addcst = 0;
      dp[i][i] = min(dp[i][i], dp[i][pick - 1] + addcst + 2 * (x[i] - x[pick]));
    }
  }
  printf("%lld", dp[N][N] + E - x[N]);
  return 0;
}
