import Foundation

/*
// 1
let N = Int(readLine()!)!

// 1 2
let split = readLine()!.componentsSeparatedByString(" ")
let N = Int(split[0])!
let S = Int(split[1])!

// 1 2 3 4 5
let array = readLine()!.componentsSeparatedByString(" ").map { Int($0)! }

func pow(_ number: Int, multiplier: Int) -> Int {
  var answer = 1
  for _ in 0 ..< multiplier {
    answer *= number 
  }
  return answer
}


*/
let split = readLine()!.componentsSeparatedByString(" ")
let A = Double(split[0])!
let B = Double(split[1])!
let A_S = Int(A * 12.5)
let A_E = Int((A + 1) * 12.5)
let B_S = Int(B * 10.0)
let B_E = Int((B + 1) * 10.0)
if A_S < B_S {
	if B_S <= A_E {
    	print(B_S)
    } else {
        print(-1)
    }
} else if A_S == B_S {
  print(A_S)
} else {
	if A_S <= B_E {
    	print(A_S)
    } else {
        print(-1)
    }
}