let readln_t2_by f = let ( @@ ) lst n = List.nth lst n in read_line () |> Str.split (Str.regexp_string " ") |> List.map f |> fun lst -> (lst @@ 0, lst @@ 1) let solve xp yp = match xp, yp with | 0, _ -> yp * 2 + 1 | _, 0 -> xp * 2 + 1 | _ -> let r = xp * xp + yp * yp |> float_of_int |> sqrt in let r2 = r |> ceil in let ans = (int_of_float r2) * 2 in if r < r2 then ans else ans + 1 let () = let xp, yp = readln_t2_by int_of_string in solve xp yp |> string_of_int |> print_endline