// AtCoder My Practice
// author: Leonardone @ NEETSDKASU

[<EntryPoint>]
let main _ =
    let n = stdin.ReadLine() |> int
    let k = stdin.ReadLine() |> int
    seq { 1..n }
    |> Seq.fold (fun a _ -> a + min a k) 1
    |> printfn "%d"
    0