object Main {
  // 標準入力
  import scala.io.StdIn._
  def readints: Array[Long] = readLine split " " map (_.toLong)
  //
  def main(args: Array[String]) = {
    val Array(a, b) = readints
    val la = (a * 12.5).ceil.toLong
    val ua = ((a + 1) * 12.5).ceil.toLong
    val lb = (b * 10).ceil.toLong
    val ub = ((b + 1) * 10).ceil.toLong
    val lc = Math.max(la, lb)
    val uc = Math.min(ua, ub)
    if (lc < uc) {
      println(s"$lc")
    } else {
      println(s"-1")
    }
  }
}
