import java.util.Scanner; import java.util.Arrays; public class Exercise55{ public static void main (String[] args){ Scanner sc = new Scanner(System.in); String str = sc.next(); String[] strArray = str.split(""); int tCount = 0; int rCount = 0; int eeCount = 0; for(int i = 0; i < strArray.length; i++){ if (strArray[i].equals("t")){ tCount++; }else if (strArray[i].equals("r")){ rCount++; }else if (strArray[i].equals("e")){ eeCount++; } } eeCount /= 2; int min = Math.min(tCount, Math.min(rCount, eeCount)); System.out.println(min); } }