#include <bits/stdc++.h>
using namespace std;
int n;
long long t, e, x[100005], mem[100005];
int main() {
  scanf("%d%lld%lld", &n, &e, &t);
  for (int i = 0; i < n; i++) scanf("%lld", &x[i]);
  mem[0] = (x[0] + t);
  for (int i = 1; i < n; i++) {
    mem[i] = max(t, x[i] + x[i] - x[0]) + x[i] - x[0];
    mem[i] = min(mem[i], mem[i - 1] + x[i] - x[i - 1] + t);
    for (int j = 0; j < i - 1; j++)
      mem[i] = min(mem[i], mem[j] + max(t, x[i] - x[j] + x[i] - x[j + 1]) +
                               x[i] - x[j + 1]);
  }
  printf("%lld\n", mem[n - 1] + e - x[n - 1]);
}
