#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
long long x[maxn], dp[maxn];
long long dis(int fi, int se) { return abs(x[fi] - x[se]); }
int main() {
  ios_base::sync_with_stdio(false);
  int n, e, t;
  cin >> n >> e >> t;
  for (int i = 1; i <= n; i++) cin >> x[i];
  memset(dp, 63, sizeof dp);
  dp[0] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i; j >= 1; j--) {
      dp[i] = min(dp[i], dp[j - 1] + dis(j - 1, j) + 3 * dis(j, i) +
                             max(0ll, t - 2 * dis(j, i)));
    }
  }
  cout << dp[n] + e - x[n] << endl;
}
