package m.shin; import java.util.Scanner; public class Con279 { public static void main(String[] args) { Scanner s = new Scanner(System.in); StringBuilder sb = new StringBuilder(s.nextLine()); s.close(); int t = 0,r = 0,e = 0; for(int i = 0;i < sb.length();i++){ switch(sb.charAt(i)){ case 't':t++; break; case 'r':r++; break; case 'e':e++; break; } } e = e / 2; System.out.println(Math.min(t, Math.min(r, e))); } }