using System; public class Program { public static void Main() { //int num = int.Parse(Console.ReadLine() ?? string.Empty); //string[] num = (Console.ReadLine() ?? string.Empty).Trim().Split(' '); string str = Console.ReadLine() ?? string.Empty; int t = 0; int r = 0; int e = 0; foreach (char c in str) { if(c == 't') { t++; } if(c == 'r') { r++; } if(c == 'e') { e++; } } str = ""; int count = 0; while (t > 0 && r > 0 && e >= 2) { if(t >= 1 && r >= 1 && e >= 2) { count++; t--; r--; e-=2; } } Console.WriteLine(count); } }