import java.util.Scanner; public class Main{ private static Scanner sc=new Scanner(System.in); public static void main(String args[])throws Exception{ int t=0,r=0,e=0; char are[]=sc.nextLine().toCharArray(); for(char element:are){ switch(element){ case't':t++;break; case'r':r++;break; case'e':e++;break; } } int min=Math.min(Math.min(t,r),e/2); System.out.println(min); } }