#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
long long dp[MAXN];
int A[MAXN];
int N, T, E;
int main() {
  scanf("%d%d%d", &N, &E, &T);
  for (int i = 1; i <= N; i++) scanf("%d", &A[i]);
  for (int i = 1; i <= N; i++) {
    long long &ret = dp[i];
    ret = (0x3f3f3f3f3f3f3f3fll);
    for (int j = 0; j < i; j++) {
      long long t = dp[j] - A[j] - A[j + 1] * 2 +
                    max(0ll, long long(T) - long long(A[i] - A[j + 1]) * 2);
      t += long long(A[i]) * 3;
      (ret) = min((ret), (t));
    }
  }
  printf("%lld\n", dp[N] + E - A[N]);
  return 0;
}
