eps :: Double
eps = 1e-10

main :: IO ()
main = do
  [a, b] <- fmap (map read . words) getLine
  let low = ceiling $ (-eps) + max (12.5 * a) (10 * b)
      high = floor $ (-eps) + min (12.5 * a + 12.5) (10 * b + 10)
  putStrLn $ show $ if low <= high then low else -1