#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 58;
int N, T, E, X[2002];
long long dp[2003][2003];
long long getCost(int Left, int Right) {
  if (Left > Right) {
    return (0);
  } else if (Left == Right) {
    return (T);
  } else {
    long long Time = X[Right] - X[Left];
    long long ret = Time * 2;
    ret += max(0LL, T - Time * 2);
    return (ret);
  }
}
long long rec(int endd, int idx) {
  if (idx >= N) return (INF);
  if (idx == N - 1) return (getCost(endd, idx));
  if (~dp[endd][idx]) return (dp[endd][idx]);
  long long ret = INF;
  ret = min(ret,
            rec(idx + 1, idx + 1) + getCost(endd, idx) + X[idx + 1] - X[idx]);
  ret = min(ret, rec(endd, idx + 1) + X[idx + 1] - X[idx]);
  return (dp[endd][idx] = ret);
}
signed main() {
  cin >> N;
  if (N > 2000) throw(0);
  cin >> E >> T;
  for (int i = 0; i < N; i++) {
    cin >> X[i];
  }
  memset(dp, -1, sizeof(dp));
  cout << rec(0, 0) + X[0] + T - X[N - 1] << endl;
}
