main = do
  li <- getLine
  let [n,a,b] = map read $ words li
  let ans = compute n a b
  print ans

compute :: Int -> Int -> Int -> Int
compute n a b = p * a + min q a
  where
    (p,q) = divMod n (a+b)
