import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val n = sc.nextInt()
  val a = sc.nextInt()
  val b = sc.nextInt()

  def balls(ball: String, nextBall: String, times: Int, nextTimes: Int): LazyList[String] = (ball * times) #:: balls(nextBall, ball, nextTimes, times)

  val ballCounts = balls("b", "r", a, b).take(n).toList.mkString.take(n).count(_ == 'b')

  println(ballCounts)
}
