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

solve n a b
  | n <= a = n
  | n <= a+b = a
  | otherwise = let (p, q) = n `divMod` (a+b) in p*a + solve q a b