main = do
  [n, a, b]<- (map read . words) <$> getLine
  print $ loop True 0 0 a b n

  where
    loop p sum blue a b n =
      if sum == n
         then blue
         else if p == True
             then if sum + a > n
                     then loop False n (blue+(n - sum)) a b n
                     else loop False (sum+a) (blue+a) a b n -- Blue
             else -- Red
                  if sum + b > n
                     then loop True n blue a b n
                     else loop True (sum+b) blue a b n -- Blue