object Main extends App {
  @scala.annotation.tailrec
  def loop(n: Long, a: Long, b: Long, acc: Long): Long =
    if (n <= 0) acc else if (n < a) acc + n else loop(n - a - b, a, b, acc + a)
  val sc = new java.util.Scanner(System.in)
  val N, A, B = sc.nextLong()
  println(if (A == 0) 0 else loop(N, A, B, 0))
}
