import Foundation

func readInts() -> [Int] {
    readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let nab = [8, 0, 4]//readInts()
    let (n,a,b) = (nab[0],nab[1],nab[2])
    var ans = 0
        
    ans = n / (a + b) * a
    let rem = n % (a + b)
    ans += rem < a ? rem: a
    print(ans)
}
main()
