let n = readLine()
let narr = n!.characters.split{$0 == " "}.map(String.init)
let a = Double(narr[0])!
let b = Double(narr[1])!

let aval = a/0.08
let bval = b/0.1

if (aval == bval) {
  print(Int(aval))
}
else if (aval > bval) {
  if(floor(aval*0.1) == bval) {
    print(Int(aval))
  }
  else {
    print("-1")
  }
}
else if (bval > aval) {
  if(floor(bval*0.08) == aval) {
    print(Int(bval))
  }
  else {
    print("-1")
  }
}
else {
  print("-1")
}