defmodule Main do def main do IO.read(:line) |> String.trim() |> solve |> IO.puts() end defp solve(s) do [~r/\^\*/, ~r/\*\^/] |> Enum.map(&(Regex.scan(&1, s) |> length)) |> Enum.join(" ") end end