#include <bits/stdc++.h>
using namespace std;
int n, E, T, a[1 << 17];
long long dp[1 << 17], dp2[1 << 17];
int main() {
  cin >> n >> E >> T;
  for (int i = 1; i <= n; i++) cin >> a[i];
  dp2[0] = -2 * a[1];
  for (int i = 1, it = 1; i <= n; i++) {
    while (2 * (a[i] - a[it]) > T) it++;
    dp[i] = dp[it - 1] + T;
    if (it > 1) dp[i] = min(dp[i], dp2[it - 2] + 2 * a[i]);
    dp2[i] = dp[i] - 2 * a[i + 1];
  }
  cout << dp[n] + E;
}
