defmodule Main do def main do [{x, _}, {y, _}] = IO.read(:line) |> String.split() |> Enum.map(&Integer.parse/1) [{x2, _}, {y2, _}] = IO.read(:line) |> String.split() |> Enum.map(&Integer.parse/1) solve(x, y, x2, y2) |> IO.puts() end def solve(x, y, x2, y2) do cond do x == 0 -> y + 1 y == 0 -> x + 1 x == y && x2 == y2 -> x + 1 :else -> max(x, y) end end end