
fun main(args: Array<String>) {
    val (A, B) = readLine()!!.split(" ").map(String::toInt)

    val start = listOf(B * 10, A * 100 / 8).max()!!
    val end = listOf((B + 1) * 10, (A + 1) * 100 / 8).min()!!
    for(m in start until end) {
        val a = m * 8 / 100
        val b = m / 10
        if( a == A && b == B) {
            println("${m}")
            return
        }
    }
    println("-1")
}