#include <bits/stdc++.h>
using namespace std;
inline bool inside(int y, int x, int H, int W) {
  return (y >= 0 && x >= 0 && y < H && x < W);
}
inline int in() {
  int x;
  std::cin >> x;
  return x;
}
template <typename T>
void print(std::vector<T>& v, char c = ' ') {
  for (int i = 0; i < (v.size()); i++) {
    if (i != 0) std::cout << c;
    std::cout << v[i];
  }
  std::cout << '\n';
}
template <typename T>
void print(T x) {
  std::cout << x << '\n';
}
const int MOD = 1e9 + 7;
const int INF = 1e9 + 9;
const double EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
long long x[101010];
long long n, e, T;
long long cost;
long long dp[101010];
long long dfs(long long i = 1, long long now = 0, long long t = T) {
  long long d = x[i] - x[now];
  long long dt = max(0ll, t - 2ll * d);
  long long dT = max(0ll, T - 2ll * d);
  if (i == n) return t;
  long long& ret = dp[i];
  ret =
      min(t + d + dfs(i + 1, now + 1, T), dt + 3 * d + dfs(i + 1, now + 1, dT));
  cout << i << ":" << now << "=" << ret << '\n';
  return ret;
}
signed main() {
  memset(dp, -1, sizeof(dp));
  cin >> n >> e >> T;
  for (long long i = 0; i < (n); i++) cin >> x[i];
  cost += x[0] + e - x[n - 1];
  cout << dfs() + cost << '\n';
}
