#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++) {
      long long st = dp[j];
      long long diff = pos[i] - pos[j];
      long long diff2 = pos[i] - pos[j + 1];
      long long cur = st + pos[j + 1] - pos[j];
      long long tmp = (cur + t) - (st + diff + diff2);
      long long wait = tmp >= 0 ? tmp : 0;
      dp[i] = min(dp[i], st + diff + diff2 * 2 + wait);
    }
  }
  printf("%lld\n", e - pos[n] + dp[n]);
  return 0;
}
