object Main extends App {
  val in = scala.io.Source.stdin.getLines.toSeq
  val ls = in(0).split(' ').map(_.toInt)
  val A = ls(0)
  val B = ls(1)
  val TA = A * 100 / 8
  val TB = B * 100 / 10
  //println(TB)
  val min = Math.min(TA,TB)
  
  private def func():Int = {
   	(min to 100 * 100 / 8 + 8).foreach{ i =>
    val a = i *  8 / 100
    val b = i * 10 / 100
    if(a==A && b==B) return i  
    }
    return -1
  }
  println(func())
}

