#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  long long int n, e, t;
  cin >> n >> e >> t;
  vector<long long int> x(n);
  for (int i = 0; i < n; i++) cin >> x[i];
  vector<long long int> dp(n, 0);
  dp[0] = x[0] + t;
  for (int i = 1; i < n; i++) {
    long long int res = dp[i - 1] + x[i] - x[i - 1] + t;
    res = min(res, x[i] + x[i] - x[0] + max(0LL, t - 2 * (x[i] - x[0])) + x[i] -
                       x[0]);
    for (int j = 0; j < i; j++) {
      long long int loss = 0;
      if ((x[i] - x[j + 1]) * 2 < t) loss = t - (x[i] - x[j + 1]) * 2;
      res = min(res,
                dp[j] + x[i] - x[j] + x[i] - x[j + 1] + loss + x[i] - x[j + 1]);
    }
    dp[i] = res;
  }
  cout << dp[n - 1] + e - x[n - 1] << endl;
  return 0;
}
