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; default: break; } } int count = 0; while(t > 0){ System.out.println("t="+ t); System.out.println("r="+ r); System.out.println("e="+ e); if(t>=1 && r>=1 && e>=2){ count++; t -= 1; }else{ t -= 1; } } System.out.println(count); } }