import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.HashMap; import java.util.Map; public class No0279 { public static void main(String[] args) { try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) { char[] arr = br.readLine().toCharArray(); int t_cnt = 0; int r_cnt = 0; int e_cnt = 0; for (char c : arr) { if (c == 't') { t_cnt++; } else if (c == 'r') { r_cnt++; } else if (c == 'e') { e_cnt++; } } int n[] = {t_cnt, r_cnt, (e_cnt / 2)}; Arrays.sort(n); System.out.println(n[0]); } catch (IOException e) { e.printStackTrace(); } } }