fun main(args: Array<String>) {
    val inLine = readLine()?.split(" ").orEmpty()

    val n = inLine[0].toLong()
    val a = inLine[1].toLong()
    val b = inLine[2].toLong()

    val tmp1 = n / (a + b)
    val tmp2 = n % (a + b)

    if(tmp2 <= a) {
        println((tmp1 * a) + tmp2)
    }else{
        println((tmp1 * a) + a)
    }
}