import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Scanner; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; Scanner in = new Scanner(inputStream); PrintWriter out = new PrintWriter(outputStream); codeabbey solver = new codeabbey(); solver.solve(1, in, out); out.close(); } static class codeabbey { public void solve(int testNumber, Scanner in, PrintWriter out) { int t = 0, r = 0, e = 0; String str = in.nextLine(); // 10^6 for (char ch : str.toCharArray()) { if (ch == 't') t++; if (ch == 'r') r++; if (ch == 'e') e++; } // System.out.println("t:" + t + " ,r:" + r + " ,e:" + e); e = e / 2; int ans = Math.min(t, r); ans = Math.min(ans, e); out.println(ans); } } }