import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); char[] charS = S.toCharArray(); int[] flag = new int[]{0, 0, 0}; for(int i = 0; i < charS.length; i++) { if(charS[i] == 't') { flag[0]+=2; } else if(charS[i] == 'r') { flag[1]+=2; } else if(charS[i] == 'e') { flag[2]++; } } int min = Integer.MAX_VALUE;; for(int i = 0; i < 3; i++) { if(flag[i] < min) { min = flag[i]; } } System.out.println(min / 2); } }