{-# LANGUAGE BangPatterns, OverloadedStrings #-}
import qualified Data.ByteString.Char8 as BS

main = do
    [n,a,b] <- map ((read :: String -> Int) . BS.unpack) . BS.words <$> BS.getLine
    let q = n `div` (a+b)
    let r = n `mod` (a+b)
    print $ q*a + min a r