extractAandB :: [String] -> (Int, Int)
extractAandB xs = (read (xs!!0), read (xs!!1))

findSuitableValue :: (Int, Int) -> Int
findSuitableValue (a, b) = if null potentialSolutions then -1 else fromIntegral (head potentialSolutions)
  where
    potentialSolutions = (filter (\x -> floor ((fromIntegral x :: Float) * 0.08) == a && floor ((fromIntegral x :: Float) * 0.1) == b) . takeWhile (\x -> (fromInteger x :: Float) * 0.08 < (fromIntegral (a + 1)) && (fromInteger x:: Float) * 0.1 < (fromIntegral (b + 1)))) [10..]

main :: IO ()
main = do
  line <- getLine
  let out = (findSuitableValue . extractAandB . words) line
  putStrLn (show out)
