object Main extends App {
  val Array(n,a,b) = io.StdIn.readLine().split(' ').map(_.toLong)
  val x = n / (a + b)
  val c = (a+b) * x
  val d = if (c >= n) 0 else if (c+a <= n) a else n-c
  println(a*x+d)
}