#include <bits/stdc++.h>
using namespace std;
int st1[100010], st2[100010], r, l, r2;
long long dp[100010], a[100010], T;
int n, m;
int main() {
  scanf("%d%d%lld", &n, &m, &T);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  dp[1] = T;
  int j = 1;
  st2[r2++] = 1;
  for (int i = 2; i <= n; i++) {
    while ((a[i] - a[j]) * 2 >= T) {
      while (r) {
        int k = st1[r - 1];
        if (dp[k - 1] - a[k] * 2 >= dp[j - 1] - a[j] * 2)
          r--;
        else
          break;
      }
      st1[r++] = j;
      j++;
    }
    dp[i] = dp[st1[0] - 1] + 2 * (a[i] - a[st1[0]]);
    while (l < r2 && dp[i - 1] <= dp[st2[r2 - 1] - 1]) r2--;
    st2[r2++] = i;
    while (st2[l] < j) l++;
    dp[i] = min(dp[i], dp[st2[l] - 1] + T);
  }
  printf("%lld\n", dp[n] + m);
}
