program shik_and_game
  implicit none
  integer :: n, i, j = 0
  integer(8) :: e, t, x(100001) = 0_8, dp(0:100000) = 0_8, tmp = 0_8
  read(*,*) n, e, t
  read(*,*) x(1:n)
  x(n+1) = e
  do i = 1, n
    do while (2_8*(x(i)-x(j+1)) > t)
      tmp = min(tmp,dp(j)-2_8*x(j+1))
      j = j+1
    end do
    dp(i) = dp(j)+t
    if (j > 0) dp(i) = min(dp(i),2_8*x(i)+tmp)
  end do
  write(*,'(i0)') dp(n)+e
end program shik_and_game