import qualified Data.IntSet as S
  
main :: IO ()
main = do
  [a, b] <- map read . words <$> getLine
  print $ solve a b

solve :: Int -> Int -> Int
solve a b = case S.minView (S.intersection sa sb) of
  Nothing     -> -1
  Just (k, _) -> k
  where
    sa = S.fromList [ x | x <- [0 .. x0], floor (fromIntegral x * 0.08) == a ]
    sb = S.fromList [ x | x <- [0 .. x0], floor (fromIntegral x * 0.10) == b ]
    x0 = ceiling (101 / 0.08)