fun main (args:Array<String>) {
    var (allBalls, bBall, rBall) = readLine()!!.split(" ").map(String::toLong)
    val brBall = bBall + rBall

//    if(brBall == allBalls){
//        print(bBall)
//        return
//    }
//    if(allBalls % brBall == 0L){
//        print(allBalls / brBall * bBall)
//    }
//    else{
        if(allBalls % brBall > bBall){
            print((allBalls / brBall * bBall) + bBall)
        }
        else {
            print((allBalls / brBall * bBall) + (allBalls % brBall))
        }
//    }

}