defmodule Main do def main do IO.read(:line) |> String.to_charlist() |> solve |> IO.puts() end defp solve(s) do [ Enum.count(s, &(&1 == ?t)), Enum.count(s, &(&1 == ?r)), Enum.count(s, &(&1 == ?e)) |> div(2) ] |> Enum.min() end end