program ABC076B
    implicit none
    integer(8)::N,K,i
    integer(8)::result
    read(5,*)N,K

    do i=1,N
        if(i==1)then
            result=2**i+K*(N-i)
        else if(2**i+K*(N-i)<result)then
            result=2**i+K*(N-i)
        end if
    end do
    print'(i0)',result
end program ABC076B