main = do ab <- map read . words <$> getLine putStrLn $ show $ f ab f l = if (f1 l) == 0 then f2 l else (f2 l) + 1 f1 l = mod (last l) (head l) f2 l = div (last l) (head l)