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