import Data.List
main = do
 [a,b] <- map read . words <$> getLine :: IO [Double]
 print $ floor . (\x -> if (null x) then -1.0 else minimum x) $ filter (\x -> ((x >= a * 12.5) && (x < (a + 1) * 12.5))) [1..1250] `intersect` filter (\x -> ((x >= b * 10.0) && (x < (b+1) * 10.0))) [1..1250]