using System; public class Program { public static void Main() { string line = Console.ReadLine(); int[] arr = new int[26]; for (int i = 0; i < 26; i++) arr[i] = 0; for (int i = 0; i < line.Length; i++) arr[line[i]-'a']++; int ans = arr['e'-'a']/2; ans = Math.Min(ans, arr['r'-'a']); ans = Math.Min(ans, arr['t'-'a']); Console.WriteLine(ans); } }