open System open System.Text let min (x:int) (y:int) = if x < y then x else y [] let main args = let S:string = Console.ReadLine() let mutable t, r, e = 0, 0, 0 for x = 0 to S.Length-1 do if S.[x] = 't' then t <- t + 1 else if S.[x] = 'r' then r <- r + 1 else if S.[x] = 'e' then e <- e + 1 done e <- e / 2 let res = min (min t r) e printfn "%d" res 0