#include <bits/stdc++.h>
int N, E, T, x[112345];
const long long int INF = 2147483647;
int memo[112345];
int dp[112345];
int do_dp() {
  for (int i = 0; i < N; ++i) {
    if (i == N - 1) {
      dp[i] = std::min((x[i] - x[i - 1]) + T, (x[i] - x[i - 1]) + dp[i - 1]);
    } else {
      dp[i] = std::min((x[i] - x[i - 1]) + T,
                       std::min((x[i + 1] - x[i]) + dp[i + 1],
                                (x[i] - x[i - 1]) + dp[i - 1]));
    }
  }
  return dp[N - 1];
}
int main(void) {
  scanf("%d%d%d", &N, &E, &T);
  for (int i = 0; i < N; ++i) {
    scanf("%d", &x[i]);
  }
  for (int i = 0; i < N; ++i) {
    memo[i] = -1;
  }
  printf("%d\n", do_dp() + (E - (x[N - 1])));
  return 0;
}
