#include <bits/stdc++.h>
using namespace std;
long long n, t, e, a[100100], f[100100];
signed main() {
  scanf("%lld%lld%lld", &n, &e, &t), memset(f, 0x3f3f3f3f, sizeof(f)), f[0] = 0;
  for (long long i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (long long i = 1; i <= n; i++)
    for (long long j = 0; j < i; j++)
      f[i] = min(f[i], f[j] + (a[i] - a[j]) + 2 * (a[i] - a[j + 1]) +
                           max(0ll, t - 2 * (a[i] - a[j + 1])));
  printf("%lld\n", f[n] + e - a[n]);
  return 0;
}
