module ABC158.C

let nums = stdin.ReadLine().Split(' ') |> Array.map int

let s = seq { 1 .. 1009 }

let seq8 = s |> Seq.filter (fun x -> int (floor (double (x) * 0.08)) = nums.[0])
let seq10 = s |> Seq.filter (fun x -> int (floor (double (x) * 0.1)) = nums.[1])

seq8
|> Seq.filter (fun x -> seq10 |> Seq.contains x)
|> Seq.tryHead
|> function
| Some x -> printf "%d" x
| None -> printf "-1"
