#include <bits/stdc++.h>
#pragma GCC optimize("O3")
const double PI = acos(-1.0);
using namespace std;
const double EPS = 1e-9, eps = -1e9;
const int N = 100005;
long long n, e, t, mem[N][2], x;
vector<long long> a, b;
map<long long, long long> id;
long long dp(int i = 0, int ck = 0) {
  if (i >= n) return 0;
  long long& ret = mem[i][ck];
  if (~ret) return ret;
  ret = 4e18;
  auto it = upper_bound(a.begin(), a.end(), a[i] + t / 2);
  int j = it - a.begin();
  if (ck == 0) {
    ret = min(ret, dp(b[j], 0) + t);
    if (i + 1 != n) ret = min(ret, dp(b[j], 1) + (a[j] - a[i]) * (long long)2);
  }
  if (ck) {
    ret = min(ret, dp(i + 1, 0));
    if (i + 1 != n)
      ret = min(ret, dp(i + 1, 1) + (a[i + 1] - a[i]) * (long long)2);
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n >> e >> t;
  for (int i = 0; i < n; i++) {
    cin >> x;
    a.push_back(x);
    b.push_back(i);
  }
  a.push_back(e);
  b.push_back(n);
  memset(mem, -1, sizeof mem);
  cout << e + dp() << endl;
  return 0;
}
