using System; using System.Linq; class Program { static void Main() { string s = Console.ReadLine(); int[] tree = new int[3]; tree[0] = s.Length - s.Replace("t", "").Length; tree[1] = s.Length - s.Replace("r", "").Length; tree[2] = s.Length - s.Replace("e", "").Length; tree[2] /= 2; Console.WriteLine(tree.Min()); } }