#include <bits/stdc++.h>
using namespace std;
inline long long powmod(long long x, long long n, long long _mod) {
  long long res = 1;
  while (n) {
    if (n & 1) res = (res * x) % _mod;
    x = (x * x) % _mod;
    n >>= 1;
  }
  return res;
}
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, -1, 1};
int n, e, t;
int a[100005];
const long long inf = 1e16;
long long dp[100005];
long long sol(int x) {
  if (x >= n) return 0;
  if (dp[x] != inf) return dp[x];
  long long ret = t + sol(x + 1) + a[x + 1] - a[x];
  for (int i = x + 1; i < n; ++i) {
    long long d = a[i] - a[x];
    if (2LL * d >= 1LL * t) {
      ret = min(ret, 3LL * d + sol(i + 1) + a[i + 1] - a[i]);
    }
  }
  return dp[x] = ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  for (int i = 0; i < 100005; ++i) dp[i] = inf;
  cin >> n >> e >> t;
  for (int i = 0; i < n; ++i) cin >> a[i];
  a[n] = a[n - 1];
  cout << sol(0) + a[0] + e - a[n];
  return 0;
}
