#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 55;
int x[100001];
long long dp[2010][2010];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, T, E;
  cin >> N >> E >> T;
  for (int i = 0; i < N; i++) {
    cin >> x[i];
  }
  x[N] = E;
  fill((long long*)begin(dp), (long long*)end(dp), INF);
  dp[0][0] = x[0];
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (dp[i][j] == INF) continue;
      if (j < i) {
        long long pre = dp[j][j];
        long long tdiff = dp[i][j] - pre;
        long long xdiff = x[i] - x[j];
        long long rem = max(0LL, T - (tdiff + xdiff));
        if (xdiff * 2 + rem >= T) {
          dp[i + 1][i + 1] = min(dp[i + 1][i + 1],
                                 dp[i][j] + xdiff * 2 + rem + x[i + 1] - x[i]);
        } else {
          dp[i + 1][i] =
              min(dp[i + 1][i], dp[i][j] + xdiff * 2 + rem + x[i + 1] - x[i]);
        }
      }
      if (i == j) {
        dp[i + 1][i + 1] =
            min(dp[i + 1][i + 1], dp[i][j] + T + x[i + 1] - x[i]);
      }
      dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + x[i + 1] - x[i]);
    }
  }
  cout << dp[N][N] << endl;
}
