open System type Sol() = member this.Solve() = let S = stdin.ReadLine() let ts = Seq.fold (fun s c -> s + (if c = 't' then 1 else 0) ) 0 S let rs = Seq.fold (fun s c -> s + (if c = 'r' then 1 else 0) ) 0 S let es = Seq.fold (fun s c -> s + (if c = 'e' then 1 else 0) ) 0 S printfn "%d" (Seq.min (ts::rs::(es/2)::[]) ) let mySol = new Sol() mySol.Solve()