let pocky l k = let q = l / (2 * k) in if q * 2 * k = l then (q - 1) * k else q * k let () = print_int @@ Scanf.sscanf (read_line ()) "%d %d" pocky