#include <bits/stdc++.h>
using namespace std;
int n, e, T;
long long x[111111];
long long mem[111111];
long long dfs(long long l) {
  if (mem[l] != -1) return mem[l];
  if (l == n - 1) return T;
  if (l == n) return 0;
  long long res = T + (x[l + 1] - x[l]) + dfs(l + 1);
  for (int r = (int)(l + 1); r < (int)(n); r++) {
    long long time = (x[r] - x[l]) * 2;
    long long sum = 0;
    if (time > T) {
      sum += time;
    } else {
      sum += T - time;
    }
    sum += (x[r + 1] - x[l]);
    res = min(res, sum + dfs(r + 1));
  }
  return mem[l] = res;
}
int main() {
  cin.sync_with_stdio(false);
  cin >> n >> e >> T;
  for (int i = (int)(0); i < (int)(n); i++) cin >> x[i];
  x[n] = x[n - 1];
  memset(mem, -1, sizeof(mem));
  cout << dfs(0) + x[0] + (e - x[n - 1]) << endl;
  return 0;
}
