fun main(args: Array<String>) {
    val (A, B) = listOfInt()
    val a1 = Math.floor(A / 0.08).toInt()
    val b1 = Math.floor(B / 0.1).toInt()
    val s: Int
    val e: Int
    if (a1 < b1) {
        s = a1 - 1; e = b1 + 1
    } else {
        s = b1 - 1; e = a1 + 1
    }
    for (n in s .. e) {
        val t1 = Math.floor(n.toDouble() * 0.08).toInt()
        val t2 = Math.floor(n.toDouble() * 0.1 ).toInt()
        if (t1 == A && t2 == B) {
            println(n)
            return
        }
    }
    println(-1)
}
fun next() = readLine()!!
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map(String::toInt)
