#include <bits/stdc++.h>
using namespace std;
long long dp[100010];
int x[100010];
int n, e;
long long t;
int st;
long long mn = 3e18;
int main() {
  scanf("%d%d%lld", &n, &e, &t);
  for (int i = 1; i <= n; i++) scanf("%d", x + i);
  for (int i = 1; i <= n; i++) {
    while (2 * (x[i] - x[st + 1]) > t) {
      mn = min(mn, dp[st] - x[st] - 2LL * x[st + 1]);
      st++;
    }
    dp[i] = min(dp[i - 1] + x[i] - x[i - 1] + t, mn + 3LL * x[i]);
  }
  printf("%lld", dp[n] + e - x[n]);
  return 0;
}
