    
readInput :: Read a => IO [a]
readInput = map read . words <$> getLine

main = do
    [a, b] <- readInput
    -- x * 0.08 = a
    -- x * 0.1 = b
    let p = fromIntegral (a :: Int) / 0.08
    let q = fromIntegral (b :: Int) / 0.1
    case [ i | i <- [floor (min p q)..ceiling (max p q)], floor (fromIntegral i * 0.08) == a, floor (fromIntegral i * 0.1) == b] of
        i : _ -> print i
        _ -> print (-1)
