import Control.Applicative

main :: IO ()
main = solve <$> f >>= print
  where
    f = map read <$> words <$> getLine

solve :: [Int] -> Int
solve [n, a, b] = let (q, r) = divMod n (a + b)
                  in q * a + min a r
