#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, E, T;
  cin >> N >> E >> T;
  vector<int> x(N);
  for (int &t : x) cin >> t;
  vector<long long> A(N);
  A[0] = x[0] + T;
  for (int i = 1; i < N; i++) {
    A[i] = A[i - 1] + (x[i] - x[i - 1]) + T;
    A[i] = min(A[i],
               0LL + x[i] + (x[i] - x[0]) * 2 + max(0, T - (x[i] - x[0]) * 2));
    for (int j = 1; j < i; j++)
      A[i] = min(A[i], A[j - 1] + (x[i] - x[j - 1]) + (x[i] - x[j]) * 2 +
                           max(0, T - (x[i] - x[j]) * 2));
  }
  cout << A[N - 1] + E - x[N - 1] << endl;
}
