let () =
  let ans = ref 0 in
  Scanf.scanf "%d %d\n" @@ fun a b ->
  for y = 1 to max (a * 100 / 8) (b * 10) do
    if y * 8 / 100 = a && y / 10 = b then ans := y
  done;
  print_int (if !ans = 0 then -1 else !ans)