object Main extends App{
  import scala.io.StdIn.readLine
  
  val nab = readLine.split(" ").map(_.toLong)
  val n = nab(0)
  val b = nab(1)
  val r = nab(2)
  
  println( ( (n/(r+b))*b + Set( b,math.abs(n%(r+b)) ).min ).toString )
}
