import kotlin.math.min

fun main(args:Array<String>) {

    val (N, A, B) = readLine()!!.split(" ").map{it.toLong()}

    val ans = N / (A + B) * A

    val rem = N % (A + B)



    println(ans + min(A, rem))
}
