redBlue n a b = divs + mods'
                where
                    ab = a + b
                    divs = (n `div` ab) * a
                    mods = (n `mod` ab)
                    mods' = if mods > a then a
                                        else mods

toInt x = read x :: Integer

main = do
    nab <- getLine
    let nab' = map toInt $ words nab
        n = head nab'
        a = head $ tail nab'
        b = last nab'
    print $ redBlue n a b