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