import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.next().toLong()
    val a = sc.next().toLong()
    val b = sc.next().toLong()

    println(abc158b(n, a, b))
}

private fun abc158b(n: Long, a: Long, b: Long): Long {
    val ab = a + b
    if (ab == 0L) return 0L

    val roop = n / (a + b)
    var ans = a * roop

    if (n % (a + b) != 0L) {
        val last = n - (a + b) * roop
        if (a <= last) {
            ans += a
        } else {
            ans += last
        }
    }

    return ans
}