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