#include <bits/stdc++.h>
using namespace std;
int N;
long long E;
long long T;
long long x[100010];
long long memo[100010];
int ret[100010];
int main() {
  cin >> N >> E >> T;
  for (auto i = 0; i < N; i++) {
    cin >> x[i];
  }
  memo[0] = x[0] + T;
  ret[0] = -1;
  for (auto i = 1; i < N; i++) {
    long long wait = memo[i - 1] + (x[i] - x[i - 1]) + T;
    long long back;
    if (ret[i - 1] == -1) {
      back = x[i];
    } else {
      back = memo[ret[i - 1]] + (x[i] - x[ret[i - 1]]);
    }
    long long time = x[i] - x[ret[i - 1] + 1];
    if (2 * time < T) back += (T - 2 * time);
    back += 2 * time;
    if (wait > back) {
      memo[i] = back;
      ret[i] = ret[i - 1];
    } else {
      memo[i] = wait;
      ret[i] = i;
    }
  }
  cout << memo[N - 1] + (E - x[N - 1]) << endl;
}
