#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
long long e, t, dp[MAXN], mn = 1e17;
multiset<int> S;
int n, x[MAXN];
int main() {
  cin >> n >> e >> t;
  for (int i = 1; i <= n; i++) cin >> x[i];
  dp[1] = t;
  S.insert(0);
  int j = 1;
  for (int i = 2; i <= n; i++) {
    while (j <= i && (x[i] - x[j]) * 2 > t) {
      mn = min(mn, dp[j - 1] - 2 * x[j]);
      S.erase(dp[j - 1]);
      j++;
    }
    S.insert(dp[i - 1]);
    dp[i] = min(mn + 2 * x[i], *S.begin() + t);
  }
  cout << dp[n] + e;
}
