main = do
  [a, b] <- map (read :: String -> Int) . words <$> getLine
  print $ solve a b

rates = [0.08, 0.1]

solve a b = case compare minA minB of
  GT -> case compare maxA maxB of
    LT -> -1
    _ -> floor minA
  EQ -> floor minA
  LT -> -1
  where
    [minA, minB] = zipWith (/) [fromIntegral a, fromIntegral b] rates
    [maxA, maxB] = zipWith (/) [fromIntegral a + 1, fromIntegral b + 1] rates