#include <bits/stdc++.h>
using namespace std;
long long DP[100001];
int main() {
  int N, E, T;
  cin >> N >> E >> T;
  vector<int> x(N + 1);
  for (int i = 0; i < N; i++) cin >> x[i];
  x[N] = E;
  vector<long long> sum(N + 1);
  for (int i = 1; i <= N; i++) {
    sum[i] = sum[i - 1] + x[i] - x[i - 1];
  }
  for (int i = 0; i <= N; i++) DP[i] = INT64_MAX;
  DP[0] = x[0];
  for (int i = 0; i < N; i++) {
    for (int j = i; j < N; j++) {
      if (sum[j] - sum[i] > T) break;
      DP[j + 1] = min(DP[j + 1],
                      DP[i] + max((long long)0, (T - 2 * (sum[j] - sum[i]))) +
                          3 * (sum[j] - sum[i]) + sum[j + 1] - sum[j]);
    }
  }
  cout << DP[N] << endl;
  return 0;
}
