
toFloat :: Int -> Float
toFloat = fromRational . toRational

solve :: Int -> Int -> [Int] -> Int
solve a b [] = -1
solve a b (s:ss)
    | a == a' && b == b' = s
    | otherwise = solve a b ss
        where
            s' = toFloat s
            a' = floor $ s' * 0.08
            b' = floor $ s' * 0.1

main = do
    [a,b] <- map read . words <$> getLine :: IO [Int]
    print $ solve a b [1..1000]
