import Data.List
main :: IO ()
main = do
    [a,b] <- getLine >>= return . (map (read :: String -> Double)) . words
    let x = filter (isIn (10 * b) (10 * (b+1))) $ filter (isIn (12.5 * a) (12.5 * (a+1))) [0..1000]
    putStrLn . show $ if x == [] then -1 else minimum x

isIn :: Double -> Double -> Int -> Bool
isIn a b n = a <= x && x < b where x = fromIntegral n