(defmacro inner-input []
  '(Integer/parseInt (read-line)))

(defn input []
  (list (inner-input) (inner-input)))

(defn AdditionAndMultiplication [[N K]]
  (let [an (-> K Math/sqrt Math/ceil int)]
    (int
      (if (<= N an)
        (Math/pow 2 N)
        (+
          (Math/pow 2 an)
          (* K (- N an)))))))


(-> (input)
  AdditionAndMultiplication
  println)