
object Main extends App {
  val sc = new java.util.Scanner(System.in) 
  val N, A, B = sc.nextInt()
  val set = N / (A + B)
  val mod = if (N % (A + B) > A) A else N % (A + B)
  println(set * A + mod)
}

