let () = Scanf.scanf "%d %d\n" @@ fun l k -> Printf.printf "%d\n" (if l mod (2*k) = 0 then ((l / (2 * k)) - 1) * k else (l / (2 * k)) * k)