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