-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU main = print . solve . map read . words =<< getLine where calc x z = (5 + 1000 * x `div` z) `div` 10 solve [a, b] = minimum [ x + y | x <- [0..100] , y <- [0..100] , let z = x + y , z > 0 , let x1 = calc x z , let y1 = calc y z , x1 == a && y1 == b]