fun main(args: Array<String>) {
    val (n, a, b) = readLine()!!.split(" ").map { it.toLong() }
    val sum = a + b
    val count : Long = n/sum
    val amari = a - (n - count*sum)
    if(amari > 0L) println(a*count + n - count*sum)
    else println(a*count + a)
}