#include <bits/stdc++.h>
int T;
int x[100010];
long long dp[100010];
long long val(int i, int j) {
  int d1 = x[j] - x[j - 1];
  int d2 = 2 * (x[i] - x[j]);
  if (d2 < T) d2 = T;
  int d3 = x[i] - x[j];
  return dp[j - 1] + d1 + d2 + d3;
}
int main() {
  int N, E;
  scanf("%d%d%d", &N, &E, &T);
  for (int i = 1; i <= N; i++) scanf("%d", &x[i]);
  for (int i = 1; i <= N; i++) dp[i] = LLONG_MAX;
  for (int i = 1; i <= N; i++) {
    int rs = 1, re = i;
    long long res = LLONG_MAX;
    for (;;) {
      if (re - rs < 3) {
        for (int r = rs; r <= re; r++) {
          long long v = val(i, r);
          if (v < res) res = v;
        }
        break;
      }
      int r1 = (rs * 2 + re) / 3, r2 = (rs + re * 2) / 3;
      long long v1 = val(i, r1), v2 = val(i, r2);
      if (v1 < v2) {
        res = v1;
        re = r2;
      } else {
        res = v2;
        rs = r1;
      }
    }
    dp[i] = res;
  }
  printf("%lld\n", dp[N] + E - x[N]);
  return 0;
}
