using System; using System.Collections.Generic; using System.Linq; using System.Text; class yc { public static void Main() { string str = Console.ReadLine(); List listStr = new List(); int[] trees = new int[3]; int key; for (int i = 0; i < str.Length; i++) { listStr.Add(str[i]); } for (int i = 0; i < str.Length; i++) { key = listStr.IndexOf('t'); if (key != -1) { trees[0]++; listStr.Remove(listStr[key]); } key = listStr.IndexOf('r'); if (key != -1) { trees[1]++; listStr.Remove(listStr[key]); } key = listStr.IndexOf('e'); if (key != -1) { trees[2]++; listStr.Remove(listStr[key]); } } trees[2] /= 2; Console.WriteLine(trees.Min()); } }