#include <bits/stdc++.h>
using namespace std;
vector<vector<long> > dp;
vector<long> vec;
long n, e, t;
int main() {
  cin >> n >> e >> t;
  dp = vector<vector<long> >(n + 1, vector<long>(n + 1, 2147483600123456789));
  vec.resize(n + 1);
  vec[0] = 0;
  for (int i = (int)(0); i < (int)(n); i++) scanf("%d", &vec[i + 1]);
  if (n > 2000) {
    cout << -1 << endl;
    return 0;
  }
  dp[0][0] = 0;
  for (int j = (int)(0); j < (int)(n + 1); j++)
    for (int i = (int)(j); i < (int)(n + 1); i++)
      if (dp[i][j] != 2147483600123456789) {
        if (i < n && dp[i][j] + vec[i + 1] - vec[i] < dp[i + 1][j]) {
          dp[i + 1][j] = dp[i][j] + vec[i + 1] - vec[i];
        }
        if (i > 0 && i != j) {
          long tim = max(t - 2 * (vec[i] - vec[j + 1]), 0L) +
                     2 * (vec[i] - vec[j + 1]) + dp[i][j];
          if (tim < dp[i][i]) {
            dp[i][i] = tim;
          }
        }
      }
  cout << dp[n][n] + e - vec[n] << endl;
  return 0;
}
