solve :: Int -> Int -> Int -> Int
solve n a b = d * a + min a m
    where d = n `div` (a+b)
          m = n `mod` (a+b)


main :: IO ()
main = do
    [n, a, b] <- map read . words <$> getLine
    print $ solve n a b