(*
ocamlfind ocamlopt -package batteries -linkpkg main.ml -o a.out
*)
open Batteries

let n, a, b = Scanf.sscanf (read_line ()) "%d %d %d" (
        fun n a b -> 
                n, a, b
)


let ablue = 
        let amari = n mod (a + b) in
                if amari < a then
                        amari
                else
                        a

let () =
        (
                let div = n / (a + b) in
                let sblue = a * div in
                        sblue + ablue
        ) |> Printf.printf "%d\n"
