fun main(array: Array<String>) {
    var (n, a, b) = readLine()!!.split(" ").map { it.toLong() }
    var ans = n / (a+b) * a
    val amari = n % (a+b)
    ans += if(amari <= a) {
        amari
    }
    else {
        a
    }
    print(ans)
}