let () =
  let n, (a, b) = Scanf.scanf "%d %d %d\n" (fun n a b -> (n, (a, b))) in
  let sum = a + b in
  let p = n / sum and q = n mod sum in
  if p >= 1 && q >= a then print_int ((a * p) + a)
  else if p >= 1 && q < a then print_int ((a * p) + q)
  else if q >= a then print_int a
  else print_int q
