{-# LANGUAGE OverloadedStrings #-}
import Data.Char
import Data.List
import Control.Monad
import qualified Data.ByteString.Char8 as BS

main :: IO ()
main = do
  [n,a,b] <- parseLine <$> BS.getLine
  BS.putStrLn . BS.pack . show $ solve n a b
  where
     parseLine = unfoldr (BS.readInt . BS.dropWhile isSpace)


solve :: Int -> Int -> Int -> Int
solve _ 0 _ = 0
solve n a b = let (d,m) = n `divMod` (a+b) in d * a + (min m a)