let readIntArray () =
    stdin.ReadLine().Split(" ") |> Array.map int

readIntArray ()
|> fun [| n; a; b |] ->
    let x = n / (a + b) * b
    if n % (a + b) <= a then x else x + n % (a + b) - a
|> printfn "%d"
