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

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

main = do
    [a, b] <- getIntList
    let ps = [n |n <- [(10*b)..(10*b+9)],  zei8 n == a]
    print $ if null ps then (-1) else head ps
    
zei8 n = (n * 8) `div` 100