#include <bits/stdc++.h>
using namespace std;
const int INF = 0x60000000;
const int MINF = -1000000000;
const int mod = 1000000007;
const int cons = 100001;
const double pi = 3.141592653589793;
const int sqrtMax = 317;
const int blocks = cons / 3;
long long dp[2001];
long long pos[2001];
int n;
long long e, t;
int main() {
  scanf("%d%lld%lld", &n, &e, &t);
  for (int i = 1; i <= n; i++) scanf("%lld", &pos[i]);
  for (int i = 1; i <= n; i++) {
    dp[i] = 1e18;
    for (int j = 0; j < i; j++) {
      dp[i] = min(
          dp[i], dp[j] - pos[j] + pos[i] + max(t, 2 * pos[i] - 2 * pos[j + 1]));
    }
  }
  printf("%lld\n", e - pos[n] + dp[n]);
  return 0;
}
