using System; namespace yukicoder { class Program { static void Main(string[] args) { string s = Console.ReadLine(); string[] t = {"t","r","e" }; int[] a = new int[4]; int count = 0; for(int i = 0; i < s.Length; i++) { string b = s.Substring(i, 1); for (int j = 0; j < t.Length; j++) { if ( b== t[j]) { a[j]++; } } } a[2] /= 2; for(; ; ) { a[0] -= 1; a[1] -= 1; a[2] -= 1; if (a[0] >= 0 && a[1] >= 0 && a[2] >= 0) { count++; } else { break; } } Console.WriteLine(count); } } }