
toTuple :: [String] -> (Int, Int, Int)
toTuple xs = (read (xs!!0), read (xs!!1), read (xs!!2))

calculateBlueBalls :: (Int, Int, Int) -> Int
calculateBlueBalls (n, b, r) | b == 0 = 0
                             | otherwise = (n `div` (b + r) * b) + min b (n `mod` (b + r))

main :: IO ()
main = do
  line <- getLine
  let out = (show . calculateBlueBalls . toTuple . words) line
  putStrLn out
