#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;

const int maxn = 100010;
typedef long long ll;
int n, e, t;
ll a[maxn], f[maxn];

int main(){
  scanf("%d%d%d", &n, &e, &t);
  for(int i = 1;i <= n;++i)scanf("%lld", &a[i]);
  memset(f, 0x3f, sizeof(f));f[0] = 0;
  ll mn = 0x3f3f3f3f3f3f3f3fLL;
  for(int i = 1, j = 0;i <= n;++i){
    while(j + 1 < i && t <= 2LL * (a[i] - a[j + 1])){
      mn = min(mn, f[j] - 2LL * a[j + 1]);
      j++;
    }
    if(t > 2LL * (a[i] - a[j + 1]))f[i] = f[j] + t;
    f[i] = min(f[i], 2LL * a[i] + mn);
    //  cout<<"for "<<i<<' '<<f[i]<<endl;
  }
  printf("%lld\n", f[n] + e);
  return 0;
}
