#include <bits/stdc++.h>
using namespace std;
long long n, t, e, x[111111], mnp, pos, dp[111111];
multiset<long long> s;
int main() {
  scanf("%I64d%I64d%I64d", &n, &e, &t);
  for (long long i = 1; i <= n; i++) {
    scanf("%I64d", &x[i]);
  }
  dp[0] = 0;
  mnp = 1e18;
  pos = 1;
  for (long long i = 1; i <= n; i++) {
    s.insert(dp[i - 1]);
    while (pos <= n) {
      if (2 * (x[i] - x[pos]) > t) {
        mnp = min(mnp, dp[pos - 1] - 2 * x[pos]);
        s.erase(s.find(dp[pos - 1]));
        pos++;
      } else
        break;
    }
    dp[i] = min(*s.begin() + t, mnp + 2 * x[i]);
  }
  printf("%I64d\n", dp[n] + e);
  return 0;
}
