let [|d1; d2|] = stdin.ReadLine().Split " " |> Array.map float if d2 / 2. > d1 then 0 elif d2 / 2. = d1 then 4 elif d2 > d1 then 8 elif d2 = d1 then 4 else 0 |> printfn "%d"