import java.util.*

fun main(args: Array<String>) {
    val list: List<Int> = readLine()!!.split(" ").map { it.toInt() }

    val A = list[0].toDouble() / 0.08
    val A2 = (list[0] + 1 ).toDouble() / 0.08
    val B = list[1].toDouble() / 0.10
    val B2 = (list[1] + 1 ).toDouble()/ 0.10

    when{
        A <= B && B < A2 -> print(Math.round(B).toInt())
        B <= A && A < B2 -> print(Math.round(A).toInt())
        else -> print("-1")
    }
}