package yukicoder; import java.util.Scanner; public class Yuki279 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String str = scan.next(); scan.close(); String strArr[] = str.split(""); int t = 0; int r = 0; int e = 0; for(int i = 0; i < strArr.length; i++ ) { switch (strArr[i]) { case "t": t += 1; break; case "r": r += 1; break; case "e": e += 1; break; } } int count = 0; while(t >= 1 && r >= 1 && e >= 2){ if(t>=1 && r>=1 && e>=2){ count++; t -= 1; r -= 1; e -= 2; } else { break; } } System.out.println(count); } }