countBlue :: Integer -> Integer -> Integer -> Integer
countBlue n a b = let (d,m) = n `divMod` (a+b) in (a*d) + (minimum [a,m])
--   | n > a+b   = a + (countBlue (n-a-b) a b)
--   | n < a     = n
--   | otherwise = a

main = do
   [n,a,b] <- map read . words <$> getLine
   putStrLn $ show $ countBlue n a b