let n = read_int ()
let k, ans = read_int (), ref max_int
let _ = for i = 0 to n do let x = ref 1 in for j = 1 to i do x := !x * 2 done; x := !x + (n - i) * k; ans := min !ans !x done; Printf.printf "%d\n" !ans