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

rates = [0.08, 0.1]

solve a b = if start > finish then -1 else start
  where
    [minA, minB] = zipWith (/) [fromIntegral a, fromIntegral b] rates
    [maxA, maxB] = zipWith (/) [fromIntegral a + 1, fromIntegral b + 1] rates
    [start, finish] = [ceiling (minA `max` minB), fixup (maxA `min` maxB)]
    fixup x
      | fromIntegral (floor x) == x = floor (x - 1)
      | otherwise = floor x