object Main {
  // 標準入力
  import scala.io.StdIn._
  def readints: Array[Long] = readLine split " " map (_.toLong)
  //
  def main(args: Array[String]) = {
    val Array(n, a, b) = readints
    val m = n / (a + b)
    println(s"${m * a + Math.min(a, n % (a + b))}")
  }
}
