import           Data.List  (intersect)
import           Data.Maybe (fromMaybe, listToMaybe)

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

solve :: Int -> Int -> Int
solve a b = fromMaybe (-1) . listToMaybe $ intersect xs ys
  where xs = prices 8 a
        ys = prices 10 b

prices :: Int -> Int -> [Int]
prices t a = [x .. y]
  where x = (a * 100 + t - 1) `div` t
        y = (a + 1) * 100 `div` t
