import Control.Applicative ((<$>))

main :: IO ()
main = solve <$> map read <$> words <$> getLine >>= print

solve :: [Int] -> Int
solve [a,b] | a == 0 && b == 100 = 1
            | a == 100 && b == 0 = 1
            | otherwise = f 1 1
  where f x y | px > a = f x (y+1)
              | px < a = f (x+1) y
              | py > b = f (x+1) y
              | py < b = f x (y+1)
              | otherwise = x + y
          where px = prct x (x+y)
                py = prct y (x+y)
        
prct x y = let (q, r) = divMod (x * 1000 `div` y) 10 in if r >= 5 then q+1 else q