#include <bits/stdc++.h>
using namespace std;
long long n, e, t;
long long dp[100005], p[100005];
long long mx = 1e18;
multiset<long long> s;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> e >> t;
  for (int i = 1; i <= n; i++) cin >> p[i];
  dp[0] = 0;
  int pos = 0;
  for (int i = 1; i <= n; i++) {
    s.insert(dp[i - 1]);
    while (pos <= i) {
      if ((p[i] - p[pos]) * 2 > t) {
        mx = min(dp[pos - 1] - p[pos] * 2, mx);
        s.erase(dp[pos - 1]);
        pos++;
      } else
        break;
    }
    dp[i] = min(*s.begin() + t, mx + 2 * p[i]);
  }
  cout << dp[n] + e;
  return 0;
}
