let [|a;b|] = stdin.ReadLine().Split() |> Array.map int
let amin = (a * 100 + 7) / 8
let amax = ((a + 1) * 100 + 7) / 8
let bmin = (b * 100 + 9) / 10
let bmax = ((b + 1) * 100 + 9) / 10
if amin>=bmax || bmin>=amax then stdout.WriteLine -1
else [amin;bmin] |> List.max |> stdout.WriteLine