    #include <vector>
    #include <cstdio>
    using namespace std;
     
    int n;
    long long e,t;
    long long x[100005];
    long long dp[100005];
     
    int main(){
      scanf("%d%lld%lld", &n,&e,&t);
      for(int i=0; i<n; ++i){
        scanf("%lld", &x[i]);
        x[i]<<=1;
      }
      x[n] = e<<1;
     
      long long w = 1ll<<57;
      for(int i=0, j=0; i<n; ++i){
        while(j<i && t < (x[i] - x[j]) ){
          w = min(w, dp[j] + (x[i] - x[j]) );
          j++;
        }
        dp[i+1] = min(w, dp[j] + max((x[i]-x[j]) ,t));
        w += (x[i+1] - x[i]);
      }
      printf("%lld\n", dp[n] + e);
      return 0;
    }