using System.Collections.Generic; using System; using System.Linq; using System.Drawing; namespace yukicoder { class Program { static void Main(string[] args) { string S = Console.ReadLine(); string[] str = new string[S.Length]; int Tcount = 0 , Rcount = 0 , Ecount = 0 , treecount = 0; for(int i = 0; i < S.Length; i++) { str[i] = S.Substring(i, 1); if (str[i] == "t") { Tcount++; } else if (str[i] == "r") { Rcount++; } else if (str[i] == "e") { Ecount++; } } while (Tcount >= 1 && Rcount >= 1 && Ecount >= 2) { Tcount = Tcount - 1; Rcount = Rcount - 1; Ecount = Ecount - 2; treecount++; } Console.WriteLine(treecount); } } }