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 = {0,0,0}; int key; for (int i = 0; i < str.Length; i++) { listStr.Add(str[i]); } //for (int i = 0; i < str.Length; i++) while(listStr.Contains('t') || listStr.Contains('r') || listStr.Contains('e')) { 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()); } }