import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS

readInt = fst . fromJust . BS.readInteger
readIntList = map readInt . BS.words
getIntList = readIntList <$> BS.getLine

main = do
    [n, a, b] <- getIntList
    putStrLn . show $ let res = n `divMod` (a+b)
                          q = fst res
                          r = snd res
                      in q * a + if r > a then a else r