-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU {- 解説読後 http://yukicoder.me/problems/814/editorial -} main = print . solve . map read . words =<< getLine where calc x z = ((1000 * x `div` z) + 5) `div` 10 solve [a, b] = minimum [ c | ai <- [0..201] , bi <- [0..201] , let c = ai + bi , c > 0 , let y = calc ai c , let z = calc bi c , a == y && b == z]