fun main(args: Array<String>) {
    val input = readLine()!!.split(" ")
    val num = input[0].toLong()
    val blue = input[1].toLong()
    val red = input[2].toLong()

    val shou = num / (blue + red)
    val amari = num % (blue + red)

    val result = shou * blue + if (amari < blue) {
        amari
    } else {
        blue
    }

    println(result)
}