import           Control.Monad
import qualified Data.ByteString.Char8 as BS
import           Data.Maybe

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
  [a, b] <- getIntList
  let solve x | x > 1000 = -1
              | otherwise =
                if floor (0.08 * fromIntegral x) == a &&
                   floor (0.10 * fromIntegral x) == b
                then x
                else solve (x+1)
  print $ solve 10