let [|n;a;b|] = stdin.ReadLine().Split() |> Array.map int64
if a=0L && b=0L then stdout.WriteLine 0
else
    let div = n / (a + b)
    let dif = n - div * (a + b)
    let lef = [a;dif] |> List.min
    a*div + lef |> stdout.WriteLine