package yuki_coder; import java.util.Scanner; public class No_279 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.nextLine(); sc.close(); String str; int t = 0; int r = 0; int e = 0; int tree = 0; int memory = 0; for(int i = 1; i <= S.length(); i++){ str = S.substring(i-1,i); if(str.equals("t")){ t++; } if(str.equals("r")){ r++; } if(str.equals("e")){ e++; } } memory = t; if(memory > r){ memory = r; } if(memory > e/2){ memory = e/2; } tree = memory; System.out.println(tree); } }