package yukicoder; import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { BufferedReader buff = new BufferedReader(new InputStreamReader(System.in)); try { char[] tree = {'t', 'r', 'e'}; int[] count = new int[tree.length]; String S = buff.readLine(); for(int i = 0; i < S.length(); ++i){ for(int j = 0; j < tree.length; ++j){ if(S.charAt(i) == tree[j]){ count[j]++; } } } count[2] /= 2; int min = Integer.MAX_VALUE; for(int i = 0; i < tree.length; ++i){ if(count[i] < min){ min = count[i]; } } System.out.println(min); } catch (Exception e) { e.getStackTrace(); } } }