let f (s:string) = let arr = Array.map int <| s.Split(' ') let a,b = arr.[0],arr.[1] let c,d = a/(b*2),a%(b*2) b * (c - (if d = 0 then 1 else 0)) f <| stdin.ReadLine() |> printfn "%d"