object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val eight = sc.nextInt()
    val ten = sc.nextInt()

    val eightLowerBound = (eight.toDouble * 12.5.toDouble).ceil.toInt
    val eightUpperBound = ((eight + 1).toDouble * 12.5.toDouble).ceil.toInt
    val tenLowerBound = ten * 10
    val tenUpperBound = (ten + 1) * 10

    val lowerBound = Math.max(eightLowerBound, tenLowerBound)
    val upperBound = Math.min(eightUpperBound, tenUpperBound)

    val ans = if (lowerBound < upperBound) {
      lowerBound
    } else {
      -1
    }

    println(ans)
  }
}
