#include <bits/stdc++.h>
using namespace std;
multiset<long long> s1, s2;
long long dp[110000], dp2[110000];
int x[110000], n, E, T;
int main() {
  scanf("%d%d%d", &n, &E, &T);
  dp2[0] = T;
  s1.insert(T);
  for (int i = 1, j = 0; i <= n; i++) {
    scanf("%d", &x[i]);
    while (j < i && 2 * (x[i] - x[j + 1]) >= T) {
      s1.erase(s1.find(dp2[j]));
      dp2[j] = dp2[j] - T - 2 * (x[j + 1]);
      s2.insert(dp2[j]);
      j++;
    }
    dp2[i] = (((long long)1) << 50);
    if (!s1.empty()) dp[i] = min(dp[i], *s1.begin() + x[i]);
    if (!s2.empty()) dp[i] = min(dp[i], *s2.begin() + (long long)3 * x[i]);
    dp2[i] = dp[i] - x[i] + T;
    s1.insert(dp2[i]);
  }
  cout << dp[n] - x[n] + E;
  return 0;
}
