main = do
    [n,a,b] <- map read . words <$> getLine :: IO [Int]
    let (q,r) = divMod n (a + b)
    let add = if r <= a then r else a
    print $ 
        if r == 0
            then q * a
            else q * a + add